You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there, I'm trying to figure out how etcd creates snapshot and how followers that lag behind catch up. I went through the code of triggering and creating snapshot, like CreateSnapshot() and snapshot(), and tried etcd and its raftexample.
When I am running raftexample, I can see that there are several snap files that are a few hundreds MB. IMHO, each snap file is the whole copy of the in-memory key-value store. However, given the same workload and data size, when I run etcd, I only find one large db file (~GB) and several small snap files (~KB).
In this case, I'm wondering how a follower catch up the progress.
Does the follower request snapshot from the leader? Then the leader send over the whole db file and all other snap and wal files?
After that, does the follower simply replace the db file?
Does the db file contain any applied entries that are not get snapshot? If yes, how to guarantee the follower can recover the correct state?
I'm confused by etcd's snapshot mechanism for over a week. I will greatly appreciate any help! Thank you so much in advance.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello there, I'm trying to figure out how etcd creates snapshot and how followers that lag behind catch up. I went through the code of triggering and creating snapshot, like
CreateSnapshot()
andsnapshot()
, and triedetcd
and its raftexample.When I am running raftexample, I can see that there are several snap files that are a few hundreds MB. IMHO, each snap file is the whole copy of the in-memory key-value store. However, given the same workload and data size, when I run etcd, I only find one large
db
file (~GB) and several small snap files (~KB).In this case, I'm wondering how a follower catch up the progress.
I'm confused by etcd's snapshot mechanism for over a week. I will greatly appreciate any help! Thank you so much in advance.
Beta Was this translation helpful? Give feedback.
All reactions