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>
// 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;