vinyl: make sure all statements with LSN <= snapshot LSN are dumped
In contrast to the memtx engine, which populates in-memory trees from Engine::prepare(), in case of Vinyl statements are inserted into in-memory trees after WAL write, from the Engine::commit() callback. Therefore, to make sure all statements inserted before snapshot are dumped, we must initiate checkpoint after WAL rotation. Currently, it is not true - checkpoint is initiated from Engine::beginCheckpoint(). To make Vinyl snapshots consistent (not requiring xlog replay), we have to fix that, so introduce a new callback, Engine::prepareWaitCheckpoint(), which is called right after WAL rotation, and trigger Vinyl checkpoint from it.
Showing
- src/box/engine.cc 12 additions, 0 deletionssrc/box/engine.cc
- src/box/engine.h 7 additions, 0 deletionssrc/box/engine.h
- src/box/vinyl.c 2 additions, 2 deletionssrc/box/vinyl.c
- src/box/vinyl.h 1 addition, 1 deletionsrc/box/vinyl.h
- src/box/vinyl_engine.cc 2 additions, 2 deletionssrc/box/vinyl_engine.cc
- src/box/vinyl_engine.h 1 addition, 1 deletionsrc/box/vinyl_engine.h
Loading
Please register or sign in to comment