Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etcdserver: apply() sets consistIndex for any entry type #7856

Merged
merged 2 commits into from
May 3, 2017

Commits on May 2, 2017

  1. etcdserver: apply() sets consistIndex for any entry type

    previously, apply() doesn't set consistIndex for EntryConfChange type.
    this causes a misalignment between consistIndex and applied index
    where EntryConfChange entry results setting applied index but not consistIndex.
    
    suppose that addMember() is called and leader reflects that change.
    1. applied index and consistIndex is now misaligned.
    2. a new follower node joined.
    3. leader sends the snapshot to follower
    	where the applied index is the snapshot metadata index.
    4. follower node saves the snapshot and database(includes consistIndex) from leader.
    5. restarting follower loads snapshot and database.
    6. follower checks snapshot metadata index(same as applied index) and database consistIndex,
    	finds them don't match, and then panic.
    
    FIXES etcd-io#7834
    fanminshi committed May 2, 2017
    Configuration menu
    Copy the full SHA
    5533c30 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e33b10a View commit details
    Browse the repository at this point in the history