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

vinyl: dump primary index after secondary

If a space has more than one index, appending a statement to it requires
reading the primary index to get the old tuple and delete it from
secondary indexes. This means that on local recovery from WAL, the
primary index must not be ahead of secondary indexes of the same space,
i.e. it must be dumped last. To assure that, do the following:

 - Make the dump heap prioritize indexes with greater iid if they are
   equally old.

 - Temporarily remove the primary index from the scheduler while a
   secondary index is being dumped.

Since every complete dump is consistent in vinyl, removal of a primary
index from the dump heap won't make the scheduler pick an already dumped
secondary index again, resulting in a live lock. It also guarantees that
while a primary index is exempted from the scheduler, it can't "run
ahead" of dumped secondary indexes, because only statements that had
been inserted by the start of the dump will be dumped, no matter what.

Closes #2410
parent 9e5f3757
No related branches found
No related tags found
Loading
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