From 48631c114acda864c03d71d0895ce9def9aadcd9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 23 Apr 2013 17:16:31 -0700 Subject: [PATCH] mon: revert part of PaxosService::is_readable() change In 98e23980f4ab7ba289303f72da06721c84767293 is_readable() was changed to call is_active(), but that has a check for is_bootstrapping(), so there is a semantic change. As a result, we may fail PaxosService::is_readable() (due to bootstrapping) and then try to call Paxos::wait_for_readable(). That will assert that Paxos::is_readable() is false, but it will be true and we will crash. Revert that part of the change, since the semantic change was not intentional. Signed-off-by: Sage Weil Reviewed-by: Greg Farnum --- src/mon/PaxosService.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index 7d4235e8181e0..b213342947c1c 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -514,7 +514,7 @@ public: bool is_readable(version_t ver = 0) { if ((ver > get_last_committed()) || ((!mon->is_peon() && !mon->is_leader())) - || !is_active() + || (is_proposing() || paxos->is_recovering() || paxos->is_locked()) || (get_last_committed() <= 0) || ((mon->get_quorum().size() != 1) && !paxos->is_lease_valid())) { return false; -- 2.39.5