Merge pull request #46862 from kamoltat/wip-ksirivad-fix-56392

mon/Elector: make paxos_size() an int

Reviewed-by: Ronen Friedman <rfriedma@redhat.com>
Reviewed-by: Matan Breizman <mbreizma@redhat.com>
Reviewed-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
Kefu Chai 2022-07-10 11:35:56 +08:00 committed by GitHub
commit 33f576a9c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -90,7 +90,7 @@ public:
* by making a paxos commit, but not by injecting values while
* an election is ongoing.)
*/
virtual unsigned paxos_size() const = 0;
virtual int paxos_size() const = 0;
/**
* Retrieve a set of ranks which are not allowed to become the leader.
* Like paxos_size(), This set can change between elections, but not

View File

@ -130,9 +130,9 @@ bool Elector::ever_participated() const
return mon->has_ever_joined;
}
unsigned Elector::paxos_size() const
int Elector::paxos_size() const
{
return (unsigned)mon->monmap->size();
return mon->monmap->size();
}
void Elector::shutdown()

View File

@ -240,7 +240,7 @@ class Elector : public ElectionOwner, RankProvider {
/* Retrieve the Monitor::has_ever_joined member */
bool ever_participated() const;
/* Retrieve monmap->size() */
unsigned paxos_size() const;
int paxos_size() const;
/* Right now we don't disallow anybody */
std::set<int> disallowed_leaders;
const std::set<int>& get_disallowed_leaders() const { return disallowed_leaders; }

View File

@ -147,7 +147,7 @@ struct Owner : public ElectionOwner, RankProvider {
logic.start();
}
bool ever_participated() const { return ever_joined; }
unsigned paxos_size() const { return parent->get_paxos_size(); }
int paxos_size() const { return parent->get_paxos_size(); }
const set<int>& get_disallowed_leaders() const {
return parent->get_disallowed_leaders();
}