vinyl: skip vylog if it's newer than snap
Having data in different engines checkpoint process is handled this way: - wait_checkpoint memtx - wait_checkpoint vinyl - commit_checkpoint memtx - commit_checkpoint vinyl In contrast to commit_checkpoint which does not tolerate fails (if something goes wrong e.g. renaming of snapshot file - instance simply crashes), wait_checkpoint may fail. As a part of wait_checkpoint for vinyl engine vy_log rotation takes place: old vy_log is closed and new one is created. At this moment, wait_checkpoint of memtx engine has already created new *inprogress* snapshot featuring bumped vclock. While recovering from this configuration, vclock of the latest snapshot is used as a reference. At the initial recovery stage (vinyl_engine_begin_initial_recovery), we check that snapshot's vclock matches with vylog's one (they should be the same since normally vylog is rotated along with snapshot). On the other hand, in the directory we have old snapshot and new vylog (and new .inprogress snapshot). In such a situation recovery (even in force mode) was aborted. The only way to fix this dead end, user has to manually delete last vy_log file. Let's proceed with the same resolution while user runs force_recovery mode: delete last vy_log file and update vclock value. If user uses casual recovery, let's print verbose message how to fix this situation manually. Closes #5823
Showing
- changelogs/unreleased/skip-newer-than-snap-vylog.md 4 additions, 0 deletionschangelogs/unreleased/skip-newer-than-snap-vylog.md
- src/box/memtx_engine.c 1 addition, 0 deletionssrc/box/memtx_engine.c
- src/box/vy_log.c 28 additions, 4 deletionssrc/box/vy_log.c
- src/lib/core/errinj.h 1 addition, 0 deletionssrc/lib/core/errinj.h
- test/box/errinj.result 1 addition, 0 deletionstest/box/errinj.result
- test/vinyl/gh-5823-crash_snapshot.lua 25 additions, 0 deletionstest/vinyl/gh-5823-crash_snapshot.lua
- test/vinyl/gh-5823-skip-newer-than-snap-vylog.result 81 additions, 0 deletionstest/vinyl/gh-5823-skip-newer-than-snap-vylog.result
- test/vinyl/gh-5823-skip-newer-than-snap-vylog.test.lua 24 additions, 0 deletionstest/vinyl/gh-5823-skip-newer-than-snap-vylog.test.lua
- test/vinyl/suite.ini 1 addition, 1 deletiontest/vinyl/suite.ini
Loading
Please register or sign in to comment