When a follower uses this interface to actively request a snapshot from the leader, it is not safe to just pass the request log index. For example, when the requested log index is passed by the original leader through appendRPC, but the leader is down before committing the log and the newly elected leader does not contain this log and may never reach to the request_index.
ref https://github.com/tikv/tikv/pull/13491#discussion_r1061357600
When a follower uses this interface to actively request a snapshot from the leader, it is not safe to just pass the request log index. For example, when the requested log index is passed by the original leader through
appendRPC
, but the leader is down before committing the log and the newly elected leader does not contain this log and may never reach to therequest_index
.