Skip to content
Snippets Groups Projects
Commit bc6457a1 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Roman Tsisyk
Browse files

vinyl: make snapshot consistent

A set of run files created by a snapshot is inconsistent, meaning w/o
replaying xlog it is not guaranteed that it contains a database state
that existed when the snapshot was taken. This is because we dump all
ranges independently and each range as a whole, so that if a statements
happens to be inserted to a range after snapshot was started and before
the range is dumped, it will be included in the dump. This peculiarity
stands in the way of backups and replication, both of which require a
consistent database state.

To make snapshot consistent, let's force rotation of all in-memory trees
on snapshot and make the dump task only dump trees that need to be
snapshotted if snapshot is in progress. The rotation is done lazily, on
insertion to the tree, similarly to how we handle DDL. The difference is
instead of sc_version we check vy_mem->min_lsn against checkpoint_lsn.
parent c1b25490
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