These are chat archives for atomix/atomix
Dual Intel Xeon E5-2670v2 2.5GHz Processors - 10 real cores/20 hyper-threaded cores per processor;
32GB 1600MHz DDR3 DRAM;
1Gbps Network interface card;
Ubuntu 14.04 OS;
Java HotSpot(TM) 64-Bit Server VM; version 1.8.0_31
Good question. It's because of how Atomix takes and installs snapshots. What if instead of 1, 2, and 3, entries 101, 102, and 103 were applied? Within an Atomix server is many state machines. When the log rolls over to a new segment, snapshots are taken of each state machine with no snapshots overlapping. So, a state machine's snapshot may be a few entries after the start of the log. Once all snapshots are complete, segments prior to all snapshots are deleted.
So that means the Raft log may start at index 101, but the state machine's snapshot may be at index 103. But that snapshot represents all the state from entry 1-103, so when it encounters a snapshot it installs the snapshot.
We could also just skip applying entries 101, 102, and 103, but it's possible for a snapshot that doesn't exist on a follower to be replicated after entries 101-103 are applied.
In other words, after compaction the log may look more like:
where each snapshot is for a specific state machine. Entries prior to that snapshot may be applied to that state machine, but only the snapshot represents the entire history of state up to that point since the entries prior to index 101 have been removed from disk