box: exclude uncommitted alter records from snapshot
With MVCC off (box.cfg.memtx_use_mvcc_engine = false), a memtx space read view may include a dirty (not committed to WAL) record. To prevent such records from being written to a snapshot, we sync WAL after creating a read view for a snapshot. The problem is that it doesn't work for long (yielding) DDL operations, such as building a new index, because such operations yield before waiting on WAL. As a result, a dirty DDL record may make it to a snapshot even though it may fail eventually. To fix that, let's keep track of all yielding DDL statements and exclude them from a read view using the memtx snapshot cleaner. Closes #8530 NO_DOC=bug fix
Showing
- changelogs/unreleased/gh-8530-alter-space-snapshot-fix.md 4 additions, 0 deletionschangelogs/unreleased/gh-8530-alter-space-snapshot-fix.md
- src/box/alter.cc 7 additions, 0 deletionssrc/box/alter.cc
- src/box/memtx_tx.c 9 additions, 2 deletionssrc/box/memtx_tx.c
- src/box/space.c 2 additions, 0 deletionssrc/box/space.c
- src/box/space.h 21 additions, 0 deletionssrc/box/space.h
- test/box-luatest/gh_8530_alter_space_snapshot_test.lua 77 additions, 0 deletionstest/box-luatest/gh_8530_alter_space_snapshot_test.lua
Loading
Please register or sign in to comment