]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: keep PG alive until the final onreadable context under old ch is done
authorSage Weil <sage@redhat.com>
Fri, 9 Feb 2018 23:36:44 +0000 (17:36 -0600)
committerSage Weil <sage@redhat.com>
Mon, 12 Feb 2018 20:35:28 +0000 (14:35 -0600)
The onreadable completions go through a finisher; add a final event
in that stream that keeps the PG alive while prior events flush.

flush() isn't quite sufficient since it doesn't wait for the finisher
events to flush too--only for the actual apply to have happened.

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

index 7ea31b063ae9ad6b8fb4ae1f7af2a2a942ea6264..5662e8434329fb7325198f8245812c8e0505b05c 100644 (file)
@@ -6245,6 +6245,13 @@ void PG::_delete_some()
 
     // final flush here to ensure completions drop refs.  Of particular concern
     // are the SnapMapper ContainerContexts.
+    {
+      ObjectStore::Transaction t;
+      PGRef pgref(this);
+      t.register_on_commit(new ContainerContext<PGRef>(pgref));
+      t.register_on_applied(new ContainerContext<PGRef>(pgref));
+      osd->store->queue_transaction(ch, std::move(t));
+    }
     ch->flush();
 
     ObjectStore::Transaction t;