From: Sage Weil Date: Fri, 9 Feb 2018 23:36:44 +0000 (-0600) Subject: osd/PG: keep PG alive until the final onreadable context under old ch is done X-Git-Tag: v13.0.2~222^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e48d236053de9f3bff484db0cf0185e6a668e820;p=ceph.git osd/PG: keep PG alive until the final onreadable context under old ch is done 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 --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 7ea31b063ae..5662e843432 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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)); + t.register_on_applied(new ContainerContext(pgref)); + osd->store->queue_transaction(ch, std::move(t)); + } ch->flush(); ObjectStore::Transaction t;