]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: watch() should set the WRITE flag on the op
authorSamuel Just <sam.just@inktank.com>
Thu, 6 Dec 2012 22:52:13 +0000 (14:52 -0800)
committerSamuel Just <sam.just@inktank.com>
Fri, 7 Dec 2012 00:56:41 +0000 (16:56 -0800)
This caused a bug where the watch operation bypassed the is_degraded()
check in the write path and the repop got sent to the replica where the
replica crashed due to the is_missing() assert in sub_op_modify.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
src/librados/IoCtxImpl.cc

index 01b4a943f0a62ba83f387b4946f67ee23d541729..934a10190d1a0b6ed96aeeda7576bada098dbb62 100644 (file)
@@ -1392,8 +1392,10 @@ int librados::IoCtxImpl::watch(const object_t& oid, uint64_t ver,
   prepare_assert_ops(&rd);
   rd.watch(*cookie, ver, 1);
   bufferlist bl;
-  wc->linger_id = objecter->linger(oid, oloc, rd, snap_seq, bl, NULL, 0,
-                                  NULL, onfinish, &objver);
+  wc->linger_id = objecter->linger(
+    oid, oloc, rd, snap_seq, bl, NULL,
+    CEPH_OSD_FLAG_WRITE,
+    NULL, onfinish, &objver);
   lock->Unlock();
 
   mylock.Lock();