mirror of
https://github.com/ceph/ceph
synced 2024-12-27 14:03:25 +00:00
mon: PaxosService: is_readable/writeable() depending on is_active()
Instead of depending on individual conditions. Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
This commit is contained in:
parent
b29a5b151f
commit
98e23980f4
@ -485,7 +485,7 @@ public:
|
||||
bool is_readable(version_t ver = 0) {
|
||||
if ((ver > get_last_committed())
|
||||
|| ((!mon->is_peon() && !mon->is_leader()))
|
||||
|| (is_proposing() || paxos->is_recovering() || paxos->is_locked())
|
||||
|| !is_active()
|
||||
|| (get_last_committed() <= 0)
|
||||
|| ((mon->get_quorum().size() != 1) && !paxos->is_lease_valid())) {
|
||||
return false;
|
||||
@ -507,10 +507,9 @@ public:
|
||||
* @returns true if writeable; false otherwise
|
||||
*/
|
||||
bool is_writeable() {
|
||||
return (!is_proposing() && mon->is_leader()
|
||||
&& !paxos->is_locked()
|
||||
&& paxos->is_lease_valid() && !paxos->is_bootstrapping()
|
||||
&& !paxos->is_recovering());
|
||||
return (is_active()
|
||||
&& mon->is_leader()
|
||||
&& paxos->is_lease_valid());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user