]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: revert part of PaxosService::is_readable() change
authorSage Weil <sage@inktank.com>
Wed, 24 Apr 2013 00:16:31 +0000 (17:16 -0700)
committerSage Weil <sage@inktank.com>
Wed, 24 Apr 2013 00:16:31 +0000 (17:16 -0700)
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 <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mon/PaxosService.h

index 7d4235e8181e066ae0d0e98028d61e8287bd6d0d..b213342947c1c8f55df30b836b1f5843ab1ec1c9 100644 (file)
@@ -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;