]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: PrimaryLogPG, PGBackend: complete callback even if interval changes 16536/head
authorJosh Durgin <jdurgin@redhat.com>
Sun, 23 Jul 2017 06:27:50 +0000 (02:27 -0400)
committerJosh Durgin <jdurgin@redhat.com>
Sun, 23 Jul 2017 06:27:53 +0000 (02:27 -0400)
This avoids leaking the callback passed to remove_missing_object().
Use EAGAIN to signal that the work was not completed, so we don't have
to take the pg lock and check if the interval changed again in
PGBackend.

Fixes: http://tracker.ceph.com/issues/20747
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/osd/PGBackend.cc
src/osd/PrimaryLogPG.cc

index 4bde06ef8c4b05a8930e2a1753eadfd6ddf71c4e..157b2422ab3989371bb7c54a850742faec30e295 100644 (file)
@@ -137,8 +137,10 @@ void PGBackend::handle_recovery_delete(OpRequestRef op)
   ConnectionRef conn = m->get_connection();
 
   gather.set_finisher(new FunctionContext(
-    [=](int) {
-      get_parent()->send_message_osd_cluster(reply, conn.get());
+    [=](int r) {
+      if (r != -EAGAIN) {
+       get_parent()->send_message_osd_cluster(reply, conn.get());
+      }
     }));
   gather.activate();
 }
index 8a5d3e06c5311eb0805e50ec509cd43d9c4d79a1..a8fd960b8de1a57393d8709775ba94ac7e922aa1 100644 (file)
@@ -10243,8 +10243,11 @@ void PrimaryLogPG::remove_missing_object(const hobject_t &soid,
         t2.register_on_complete(on_complete);
         int r = osd->store->queue_transaction(osr.get(), std::move(t2), nullptr);
         assert(r == 0);
+        unlock();
+       } else {
+        unlock();
+        on_complete->complete(-EAGAIN);
        }
-       unlock();
      }));
   int r = osd->store->queue_transaction(osr.get(), std::move(t), nullptr);
   assert(r == 0);