vinyl: disable tautological DELETE optimization for deferred DELETEs
If the write iterator sees that one DELETE statement follows another, which isn't discarded because it's referenced by a read view, it drops the newer DELETE, see commit a6f45d87 ("vinyl: discard tautological DELETEs on compaction"). This is incorrect if the older DELETE is a deferred DELETE statement (marked as SKIP READ) because such statements are dumped out of order, i.e. there may be a statement with the LSN lying between the two DELETEs in an older source not included into this compaction task. If we discarded the newer DELETE, we wouldn't overwrite this statement on major compaction, leaving garbage. Fix this issue by disabling this optimization for deferred DELETEs. Closes #10895 NO_DOC=bug fix (cherry picked from commit 2945a8c9fde6df9f6cbc714f9cf8677f0fded57a)
Showing
- changelogs/unreleased/gh-10895-fix-vinyl-deferred-delete-compaction.md 4 additions, 0 deletions...released/gh-10895-fix-vinyl-deferred-delete-compaction.md
- src/box/vy_write_iterator.c 8 additions, 1 deletionsrc/box/vy_write_iterator.c
- test/unit/vy_iterators_helper.h 3 additions, 0 deletionstest/unit/vy_iterators_helper.h
- test/unit/vy_write_iterator.c 31 additions, 1 deletiontest/unit/vy_write_iterator.c
- test/vinyl-luatest/gh_10895_deferred_delete_compaction_test.lua 113 additions, 0 deletions...inyl-luatest/gh_10895_deferred_delete_compaction_test.lua
Loading
Please register or sign in to comment