Repository navigation
Conversation
| if (deletionVectorsMaintainer.notifyNewDeletion( | ||
| hit.fileName(), hit.rowPosition())) { | ||
| highLevel = hit.keyValue(); |
There was a problem hiding this comment.
[P1] Roll back deletion-vector changes when compaction fails
notifyNewDeletion marks the old row in the shared deletion-vector maintainer before compaction writes its output. If writing the output fails, the mark survives. Retrying prepareCommit on the same Java writer then skips the still-valid old value and commits an incorrect aggregate.
I reproduced this with an aggregation table using sum and deletion vectors, with the original file at level 2 and the update compacting to level 1. After committing 10 for a key, I wrote 7, injected a one-time IOException when opening the compaction output, and retried prepareCommit on the same writer. The PR parent (8b641ae1f3) committed 17. This PR committed 7.
Please stage the deletion-vector changes for the compaction task and apply them only after the whole task succeeds.
There was a problem hiding this comment.
If writing the output fails, Flink/Spark job will also fail, so the modified deletion vectors will not be committed. This is not a real problem.
Purpose
Currently when looking up old records, we do not check deletion vectors, so removed records might be fetched.
This PR fixed the issue.
Tests
DeletionVectorITCase