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

contrib/raftexample: save snapshot to WAL first #8088

Merged
merged 1 commit into from
Jun 13, 2017
Merged

contrib/raftexample: save snapshot to WAL first #8088

merged 1 commit into from
Jun 13, 2017

Conversation

jbowens
Copy link
Contributor

@jbowens jbowens commented Jun 13, 2017

Save the snapshot index to the WAL before saving the snapshot to the
filesystem. This ensures that wal.Open is only ever called with a
snapshot that was previously saved to the WAL.

Fixes #8082.

@gyuho
Copy link
Contributor

gyuho commented Jun 13, 2017

@jbowens LGTM. Thanks!

/cc @xiang90 @heyitsanthony

Copy link
Contributor

@heyitsanthony heyitsanthony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks

Save the snapshot index to the WAL before saving the snapshot to the
filesystem. This ensures that we'll only ever call wal.Open with a
snapshot that was previously saved to the WAL.
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@3993f37). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #8088   +/-   ##
=========================================
  Coverage          ?   76.55%           
=========================================
  Files             ?      342           
  Lines             ?    26568           
  Branches          ?        0           
=========================================
  Hits              ?    20340           
  Misses            ?     4773           
  Partials          ?     1455

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3993f37...74e020b. Read the comment docs.

iampogo pushed a commit to Onyx-Protocol/Onyx that referenced this pull request Jun 13, 2017
Save the snapshot position to the WAL before saving the snapshot data to
disk. On boot, we open the WAL at the most recently saved snapshot's
position. If we don't save the position to the WAL first, we might open
the WAL at a snapshot position that was never saved to the WAL.

This is a fix for the 1.2.x release line.

See etcd-io/etcd#8082, etcd-io/etcd#8088.

Closes #1310
iampogo pushed a commit to Onyx-Protocol/Onyx that referenced this pull request Jun 14, 2017
Save the snapshot position to the WAL before saving the snapshot data to
disk. On boot, we open the WAL at the most recently saved snapshot's
position. If we don't save the position to the WAL first, we might open
the WAL at a snapshot position that was never saved to the WAL.

See etcd-io/etcd#8082, etcd-io/etcd#8088.

Closes #1312
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants