etcd/snap
fanmin shi 8b7b7222dd etcdserver: renaming db happens after snapshot persists to wal and snap files
In the case that follower recieves a snapshot from leader
and crashes before renaming xxx.snap.db to db but after
snapshot has persisted to .wal and .snap, restarting
follower results loading old db, new .wal, and new .snap.
This will causes a index mismatch between snap metadata index
and consistent index from db.

This pr forces an ordering where saving/renaming db must
happen after snapshot is persisted to wal and snap file.
this guarantees wal and snap files are newer than db.
on server restart, etcd server checks if snap index > db consistent index.
if yes, etcd server attempts to load xxx.snap.db where xxx=snap index
if there is any and panic other wise.

FIXES #7628
2017-05-09 14:00:12 -07:00
..
snappb *: add swagger and grpc-gateway assets for v3lock and v3election 2017-04-10 15:21:07 -07:00
db.go etcdserver: renaming db happens after snapshot persists to wal and snap files 2017-05-09 14:00:12 -07:00
message.go snap: return errors if Message's snapshot is not entirely read 2016-06-06 11:38:11 -07:00
metrics.go *: update LICENSE header 2016-05-12 20:51:48 -07:00
snapshotter.go *: use filepath.Join for files 2017-03-16 07:46:06 -07:00
snapshotter_test.go *: use filepath.Join for files 2017-03-16 07:46:06 -07:00