Skip to content

Snapshot Trigger Condition #86

Description

@JoshuaChi
  1. Large Log Gap:
    When a follower’s log lags behind the leader’s by more than a certain threshold (e.g., 10,000 uncommitted entries in etcd by default), the leader will send a snapshot directly instead of attempting to replicate entries one by one.

  2. Persistent State Check:
    The leader maintains lastIncludedIndex and lastIncludedTerm. If a follower’s prevLogIndex is less than the lastIncludedIndex, it indicates that the follower’s log has been compacted and must be brought up to date via snapshot installation.(When the leader detects that a follower’s next_index is lower than the last_purged_index, it should immediately send a snapshot.)

  3. When new node joins Cluster as Learner

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:raft-snapshotSnapshot creation, transfer, installation, and compaction triggers.

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions