From 143ec0281aa8b640617a3fe19a430248ce3b514c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 15 Feb 2014 08:59:51 -0800 Subject: [PATCH] mon/Elector: bootstrap on timeout Currently if an election times out we call a new election. If we have never joined a quorum, bootstrap instead. This is heavier weight, but captures the case where, during bootstrap: - a and b have learned each others' addresses - everybody calls an election - a and b form a quorum - c loops trying to call an election, but is ignored because a and b don't see its address in the monmap See logs: ubuntu@teuthology:/var/lib/teuthworker/archive/sage-2014-02-14_13:50:04-ceph-deploy-wip-7212-sage-b-testing-basic-plana/83194 Signed-off-by: Sage Weil (cherry picked from commit a4bcb1f8129a4ece97bd3419abf1ff45d260ad8e) --- src/mon/Elector.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mon/Elector.cc b/src/mon/Elector.cc index 1650a997b2d09..dc234282facc3 100644 --- a/src/mon/Elector.cc +++ b/src/mon/Elector.cc @@ -143,7 +143,10 @@ void Elector::expire() victory(); } else { // whoever i deferred to didn't declare victory quickly enough. - start(); + if (mon->has_ever_joined) + start(); + else + mon->bootstrap(); } } -- 2.39.5