Skip to content
Snippets Groups Projects
Commit 3a6c2ff3 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Konstantin Osipov
Browse files

vinyl: sort slices by lsn on recovery

To ease recovery, vy_recovery_iterate() iterates over slices of the same
range in the chronological order. It is easy to do, because we always
log slices of the same range in the chronological order, as there can't
be concurrent dump and compaction of the same range. However, this will
not hold when the single memory level is introduced: a dump, which adds
new slices to all ranges, may occur while compaction is in progress so
that when compaction is finished a record corresponding to the slice
created by compaction will appear after the slice created by dump,
although the latter is newer. To prevent this from breaking the
assumption made by iterators that newer slices are closer to the head of
vy_range->slices list, let's sort the list on recovery/join.
parent 10a739b5
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment