]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/MemStore: do on_apply_sync callback synchronously
authorSage Weil <sage@inktank.com>
Tue, 10 Dec 2013 16:56:35 +0000 (08:56 -0800)
committerSage Weil <sage@inktank.com>
Tue, 10 Dec 2013 16:56:35 +0000 (08:56 -0800)
We can easily deadlock if we put this in the Finisher thread behind other
work; do it synchronously!

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
src/os/MemStore.cc

index 063ae2417ceefcb72ef71bfae25c97f8a6e0c594..fdf3ee5bcf70d7320ac1884c08d9167a5db1e034 100644 (file)
@@ -651,10 +651,10 @@ int MemStore::queue_transactions(Sequencer *osr,
   Context *on_apply = NULL, *on_apply_sync = NULL, *on_commit = NULL;
   ObjectStore::Transaction::collect_contexts(tls, &on_apply, &on_commit,
                                             &on_apply_sync);
+  if (on_apply_sync)
+    on_apply_sync->complete(0);
   if (on_apply)
     finisher.queue(on_apply);
-  if (on_apply_sync)
-    finisher.queue(on_apply_sync);
   if (on_commit)
     finisher.queue(on_commit);
   return 0;