Skip to content

vinyl: disable tautological DELETE optimization for deferred DELETEs#10910

Merged
locker merged 1 commit intotarantool:masterfrom
locker:vy-deferred-delete-compaction-fix
Dec 11, 2024
Merged

vinyl: disable tautological DELETE optimization for deferred DELETEs#10910
locker merged 1 commit intotarantool:masterfrom
locker:vy-deferred-delete-compaction-fix

Conversation

@locker
Copy link
Member

@locker locker commented Dec 9, 2024

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 a6f45d8 ("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

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 a6f45d8 ("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 tarantool#10895

NO_DOC=bug fix
@locker locker requested a review from a team as a code owner December 9, 2024 14:00
@coveralls
Copy link

Coverage Status

coverage: 87.365% (+0.01%) from 87.352%
when pulling dbfeb91 on locker:vy-deferred-delete-compaction-fix
into 7b31a0c
on tarantool:master
.

@locker locker requested a review from nshy December 9, 2024 14:26
Copy link
Contributor

@nshy nshy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@nshy nshy assigned locker and unassigned nshy Dec 10, 2024
@locker locker added the full-ci Enables all tests for a pull request label Dec 11, 2024
@locker locker merged commit 2945a8c into tarantool:master Dec 11, 2024
@locker locker deleted the vy-deferred-delete-compaction-fix branch December 11, 2024 11:30
@locker
Copy link
Member Author

locker commented Dec 11, 2024

Cherry-picked to 2.11, 3.2, 3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DELETE statement may be lost on compaction because of deferred DELETE

4 participants