box: snapshot should not include rolled back data
Box.snapshot() could include rolled back data in case synchronous transaction ROLLBACK arrived during WAL rotation in preparation of a checkpoint. More specifically, snapshot consists of fixating the engines' content (creation of a read-view), doing WAL rotation, and writing the snapshot itself. All data changes after content fixation won't go into the snap. So if ROLLBACK arrives during WAL rotation, the fixated content will have rolled back data, not present in the newest dataset. The patch makes it fail if during WAL rotation anything was rolled back. The bug sometimes appeared in an existing test about qsync snapshots, but with a very poor reproducibility. In a new test file it is reproduced 100% without the patch. Closes #5167
Showing
- src/box/gc.c 11 additions, 1 deletionsrc/box/gc.c
- src/box/wal.c 4 additions, 0 deletionssrc/box/wal.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/replication/gh-5167-qsync-rollback-snap.result 165 additions, 0 deletionstest/replication/gh-5167-qsync-rollback-snap.result
- test/replication/gh-5167-qsync-rollback-snap.test.lua 67 additions, 0 deletionstest/replication/gh-5167-qsync-rollback-snap.test.lua
- test/replication/suite.ini 1 addition, 1 deletiontest/replication/suite.ini
Loading
Please register or sign in to comment