]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Paxos: reset accept timeout before submiting work to the store 4074/head
authorJoao Eduardo Luis <joao@redhat.com>
Wed, 10 Dec 2014 17:46:35 +0000 (17:46 +0000)
committerLoic Dachary <ldachary@redhat.com>
Wed, 18 Mar 2015 22:23:56 +0000 (23:23 +0100)
Otherwise we may trigger the timeout while waiting for the work to be
committed to the store -- and it would only take the write to take a bit
longer than 10 seconds (default accept timeout).

We do wait for the work to be properly committed to the store before
extending the lease though.

Fixes: #10220
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
(cherry picked from commit 18534615f184ba56b441fd1d4242eb06debdfe13)

src/mon/Paxos.cc

index 85cfb4f2f5d3d12adb2f24c1c59aade48b7e7527..b9ee126ee9ca91fe3cd658555e68c5432bc7034e 100644 (file)
@@ -846,6 +846,12 @@ void Paxos::commit_start()
     state = STATE_WRITING;
   else
     assert(0);
+
+  if (mon->get_quorum().size() > 1) {
+    // cancel timeout event
+    mon->timer.cancel_event(accept_timeout_event);
+    accept_timeout_event = 0;
+  }
 }
 
 void Paxos::commit_finish()
@@ -900,16 +906,12 @@ void Paxos::commit_finish()
 
   if (do_refresh()) {
     commit_proposal();
-
-    finish_contexts(g_ceph_context, waiting_for_commit);
-
     if (mon->get_quorum().size() > 1) {
-      // cancel timeout event
-      mon->timer.cancel_event(accept_timeout_event);
-      accept_timeout_event = 0;
       extend_lease();
     }
 
+    finish_contexts(g_ceph_context, waiting_for_commit);
+
     assert(g_conf->paxos_kill_at != 10);
 
     finish_round();