Skip to content

Commit aa1e501

Browse files
committed
SERVER-21117 Do not update term in protocol version 0
1 parent 649fab4 commit aa1e501

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/mongo/db/repl/replication_coordinator_impl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,6 +3127,11 @@ Status ReplicationCoordinatorImpl::updateTerm(long long term) {
31273127
}
31283128

31293129
bool ReplicationCoordinatorImpl::_updateTerm_incallback(long long term) {
3130+
if (!isV1ElectionProtocol()) {
3131+
warning() << "Cannot update term in election protocol version 0";
3132+
return false;
3133+
}
3134+
31303135
auto now = _replExecutor.now();
31313136
bool updated = _topCoord->updateTerm(term, now);
31323137
{

0 commit comments

Comments
 (0)