Closed unixod closed 4 weeks ago
pack
is invoked in leader's side when below conditions are met. Let's say S1 is leader (pack
) and S2 is follower (apply_pack
).
params->log_sync_stop_gap_ > 0
. ANDnext_slot()
< S1's start_index()
. ANDnext_slot()
+ params->log_sync_stop_gap_
.Then apply_pack
's first parameter (index
you referred to) will always be S2's next_slot()
. Leader always sends the log starting from next_slot()
of the follower, so none of three can be possible, unless follower's log store is changed before receiving the pack
message from the leader.
Thanks!
Hi,
Could you help to clarify preconditions which
apply_pack
may rely on? In particular I'm wondering which of cases listed below are possible.(In the list below by index I refer to first parameter of
apply_pack
)If 3rd case is possible then may we truncate log entries which go after
index + number_of_logs(pack)
as part ofapply_pack
execution?