]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc: invoke notify finish context on linger commit failure 21786/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 2 May 2018 16:52:42 +0000 (12:52 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 4 May 2018 12:19:35 +0000 (08:19 -0400)
Fixes: http://tracker.ceph.com/issues/23966
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librados/IoCtxImpl.cc
src/osdc/Objecter.cc

index bb8a0795771b754671bd5589ca861b11ad1cd554..668eb2f7bd11033064ce1cf5cf969a37cab56bab 100644 (file)
@@ -138,7 +138,7 @@ struct C_aio_notify_Complete : public C_aio_linger_Complete {
   }
 
   void complete(int r) override {
-    // invoked by C_notify_Finish (or C_aio_notify_Ack on failure)
+    // invoked by C_notify_Finish
     lock.Lock();
     finished = true;
     complete_unlock(r);
@@ -175,10 +175,6 @@ struct C_aio_notify_Ack : public Context {
     ldout(cct, 10) << __func__ << " linger op " << oncomplete->linger_op << " "
                    << "acked (" << r << ")" << dendl;
     oncomplete->handle_ack(r);
-    if (r < 0) {
-      // on failure, we won't expect to see a notify_finish callback
-      onfinish->complete(r);
-    }
   }
 };
 
@@ -1832,6 +1828,7 @@ int librados::IoCtxImpl::notify(const object_t& oid, bufferlist& bl,
   Context *notify_finish = new C_notify_Finish(client->cct, &notify_finish_cond,
                                                objecter, linger_op, preply_bl,
                                                preply_buf, preply_buf_len);
+  (void) notify_finish;
 
   uint32_t timeout = notify_timeout;
   if (timeout_ms)
@@ -1863,7 +1860,6 @@ int librados::IoCtxImpl::notify(const object_t& oid, bufferlist& bl,
   } else {
     ldout(client->cct, 10) << __func__ << " failed to initiate notify, r = "
                           << r << dendl;
-    notify_finish->complete(r);
   }
 
   objecter->linger_cancel(linger_op);
index b7220aa0100cb9fc21a3becf797921c4ca1a058f..20d5b682e9030970a40a41a6befc6d856e65ea23 100644 (file)
@@ -592,6 +592,10 @@ void Objecter::_linger_commit(LingerOp *info, int r, bufferlist& outbl)
     info->on_reg_commit->complete(r);
     info->on_reg_commit = NULL;
   }
+  if (r < 0 && info->on_notify_finish) {
+    info->on_notify_finish->complete(r);
+    info->on_notify_finish = nullptr;
+  }
 
   // only tell the user the first time we do this
   info->registered = true;
@@ -1654,6 +1658,10 @@ void Objecter::_check_linger_pool_dne(LingerOp *op, bool *need_unregister)
        op->on_reg_commit->complete(-ENOENT);
        op->on_reg_commit = nullptr;
       }
+      if (op->on_notify_finish) {
+        op->on_notify_finish->complete(-ENOENT);
+        op->on_notify_finish = nullptr;
+      }
       *need_unregister = true;
     }
   } else {