|
This code cleanup was caught duringĀ SERVER-46379. We should remove 'targetIndex' from ReplicationCoordinatorImpl::_handleHeartbeatResponse() to avoid any future mistakes of accessing "targetIndex" in that function, that can lead to server crash. Using targetIndex in replicationCoordinatorImpl::_handleHeartbeatResponse() is not safe because
targetIndex is the target's member index when the heartbeat was sent out by the node. But, a reconfig can make the target's member index to change the when the heart beat response was received by the node. So, ReplicationCoordinatorImpl::_handleHeartbeatResponse() should alway's use target's host and port to access member data from the in-memory config.
|