diff options
author | XueruiFa <xuerui.fa@mongodb.com> | 2021-05-03 17:35:34 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-12 16:19:26 +0000 |
commit | b5261275423215d567599f3d9862416f09e05aa2 (patch) | |
tree | c0588c389d1845df78f5810d8cdd3ce12d4d1296 /src/mongo/db/repl/member_config.h | |
parent | 3acbd9d5cd8fecdb00999eeb31be865ba0ca3244 (diff) | |
download | mongo-b5261275423215d567599f3d9862416f09e05aa2.tar.gz |
SERVER-55376: Ensure reconfig cannot roll back committed writes in PSA sets
Diffstat (limited to 'src/mongo/db/repl/member_config.h')
-rw-r--r-- | src/mongo/db/repl/member_config.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/repl/member_config.h b/src/mongo/db/repl/member_config.h index 0122b1f05a0..7cab60a61b8 100644 --- a/src/mongo/db/repl/member_config.h +++ b/src/mongo/db/repl/member_config.h @@ -132,6 +132,13 @@ public: } /** + * Gets this member's base priority, without considering the 'newlyAdded' field. + */ + double getBasePriority() const { + return MemberConfigBase::getPriority(); + } + + /** * Gets the amount of time behind the primary that this member will atempt to * remain. Zero seconds means stay as caught up as possible. */ @@ -161,6 +168,13 @@ public: } /** + * Returns the number of votes the member has, without considering the 'newlyAdded' field. + */ + int getBaseNumVotes() const { + return (getVotes() == 0) ? 0 : 1; + } + + /** * Returns true if this member is an arbiter (is not data-bearing). */ bool isArbiter() const { |