]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: only reconnect watches; skip ack unless needed
authorSage Weil <sage@redhat.com>
Mon, 17 Nov 2014 15:32:12 +0000 (07:32 -0800)
committerSage Weil <sage@redhat.com>
Thu, 4 Dec 2014 18:34:05 +0000 (10:34 -0800)
Only watches get a RECONNECT op; lingers just get resent.

Only request an ACK in the non-watch reconnect case and when an ack
callback is specified.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osdc/Objecter.cc

index 2b7fc9962b675610ca71ea97a35e6d9657467b29..a60e2b8a680d1de629428cf496cfdfde09f9d0e9 100644 (file)
@@ -418,19 +418,21 @@ void Objecter::_send_linger(LingerOp *info)
 
   vector<OSDOp> opv;
   Context *onack = NULL;
-  if (info->registered) {
+  Context *oncommit = NULL;
+  if (info->registered && info->is_watch) {
     ldout(cct, 15) << "send_linger " << info->linger_id << " reconnect" << dendl;
-    onack = new C_Linger_Reconnect(this, info);
     opv.push_back(OSDOp());
     opv.back().op.op = CEPH_OSD_OP_WATCH;
     opv.back().op.watch.cookie = info->linger_id;
     opv.back().op.watch.op = CEPH_OSD_WATCH_OP_RECONNECT;
+    oncommit = new C_Linger_Reconnect(this, info);
   } else {
     ldout(cct, 15) << "send_linger " << info->linger_id << " register" << dendl;
-    onack = new C_Linger_Register(this, info);
     opv = info->ops;
+    if (info->on_reg_ack)
+      onack = new C_Linger_Register(this, info);
+    oncommit = new C_Linger_Commit(this, info);
   }
-  Context *oncommit = new C_Linger_Commit(this, info);
   Op *o = new Op(info->target.base_oid, info->target.base_oloc,
                 opv, info->target.flags | CEPH_OSD_FLAG_READ,
                 onack, oncommit,