From 58890cfad5f7bee933baa599a68e6c65993379d4 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 6 Dec 2012 14:52:13 -0800 Subject: [PATCH] librados: watch() should set the WRITE flag on the op 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 Reviewed-by: Josh Durgin --- src/librados/IoCtxImpl.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librados/IoCtxImpl.cc b/src/librados/IoCtxImpl.cc index 01b4a943f0a62..934a10190d1a0 100644 --- a/src/librados/IoCtxImpl.cc +++ b/src/librados/IoCtxImpl.cc @@ -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(); -- 2.39.5