mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-02 21:17:01 +00:00
When storing a snapshot `snap`, if `snap.idx > e.idx` where `e` is the last entry in the log (if any), we need to clear all previous entries so that we don't create a gap in the log. The log must remain contiguous. One case is controversial: what to do if `snap.idx == e.idx + 1`. Technically no gap would be created between the entry and the snapshot. However, if we now want to store a new entry with index `e.idx + 2`, that would create a gap between two entries which is illegal.