Skip to content

Commit

Permalink
SERVER-22504 do not add self to _hbdata when removed from the set
Browse files Browse the repository at this point in the history
  • Loading branch information
matt dannenberg committed Feb 8, 2016
1 parent 9145945 commit bb591bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,11 @@ void ReplicationCoordinatorImpl::_heartbeatReconfigFinish(
myIndex = StatusWith<int>(-1);
}
const ReplicaSetConfig oldConfig = _rsConfig;
// If we do not have an index, we should pass -1 as our index to avoid falsely adding ourself to
// the data structures inside of the TopologyCoordinator.
const int myIndexValue = myIndex.getStatus().isOK() ? myIndex.getValue() : -1;
const PostMemberStateUpdateAction action =
_setCurrentRSConfig_inlock(cbData, newConfig, myIndex.getValue());
_setCurrentRSConfig_inlock(cbData, newConfig, myIndexValue);
lk.unlock();
_resetElectionInfoOnProtocolVersionUpgrade(oldConfig, newConfig);
_performPostMemberStateUpdateAction(action);
Expand Down

0 comments on commit bb591bb

Please sign in to comment.