From: Samuel Just Date: Sun, 4 Dec 2016 00:05:08 +0000 (-0800) Subject: OSD::init_op_flags: don't consider PING to be a write X-Git-Tag: v11.1.0~58^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=89fd030bf9436dc4e37cc3a0f935ec077455d9d5;p=ceph.git OSD::init_op_flags: don't consider PING to be a write Signed-off-by: Samuel Just --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 2cde841e436..73edafdcff6 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -9262,8 +9262,15 @@ int OSD::init_op_flags(OpRequestRef& op) // set bits based on op codes, called methods. for (iter = m->ops.begin(); iter != m->ops.end(); ++iter) { - if (ceph_osd_op_mode_modify(iter->op.op)) - op->set_write(); + if (!(iter->op.op == CEPH_OSD_OP_WATCH && + iter->op.watch.op == CEPH_OSD_WATCH_OP_PING)) { + /* This a bit odd. PING isn't actually a write. It can't + * result in an update to the object_info. PINGs also aren'ty + * replayed, so there's no reason to write out a log entry + */ + if (ceph_osd_op_mode_modify(iter->op.op)) + op->set_write(); + } if (ceph_osd_op_mode_read(iter->op.op)) op->set_read(); diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index db3f1e20cdb..7eaf2d2fb8f 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5496,6 +5496,9 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) dout(10) << " found existing watch " << w << " by " << entity << dendl; ctx->watch_connects.push_back(make_pair(w, true)); } else if (op.watch.op == CEPH_OSD_WATCH_OP_PING) { + /* Note: WATCH with PING doesn't cause may_write() to return true, + * so if there is nothing else in the transaction, this is going + * to run do_osd_op_effects, but not write out a log entry */ if (!oi.watchers.count(make_pair(cookie, entity))) { result = -ENOTCONN; break;