barge icon indicating copy to clipboard operation
barge copied to clipboard

Log Compaction

Open mgodave opened this issue 12 years ago • 2 comments

Design Proposal:

  1. Leader detects that the nextEntry is not in it's log and sets 'contains_snapshot' field on next AppendEntries RPC request.
  2. Follower reads the 'contains_snapshot' field and transitions to a Follower' state.
  3. Follower initiates a pull of the snapshot form the Leader (over HTTP for a first cut, pluggable transport later)
    • Follower' services AppendEntries RPC calls in a speculative manner, accepting all entries assuming the snapshot has been applied.
    • No entries are committed until the snapshot is downloaded and applied
    • After the snapshot is downloaded and applied Follower' applied the commits and transitions back to Follower

mgodave avatar Oct 25 '13 14:10 mgodave

Looks good to me. If it makes it easier, for my use case I'm going to put the snapshots on S3 (or Swift); my guess is that is fairly common. You may want to assume a 'shared filesystem' abstraction, starting with a simple File backed implementation, and then you don't have to add the HTTP replication logic just yet.

justinsb avatar Jan 14 '14 18:01 justinsb

That's almost exactly the case I was thinking of when I mentioned making this pluggable. Maybe I should make sure that gets in first and I can provide the File backed implementation first and then a bunch of add-ons later.

mgodave avatar Jan 14 '14 18:01 mgodave