// 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();
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;