[core] Fix orphan deletion-vector index entries when full compaction goes through FileRewriteCompactTask#8783
Merged
Conversation
…goes through FileRewriteCompactTask
ZZZxDong
force-pushed
the
fix-orphan-dv-index
branch
from
July 21, 2026 11:06
b454c1d to
6a6a656
Compare
Contributor
|
Both Flink tests failed, please ensure CI pass. |
Contributor
Author
|
The failing job is "UTCase and ITCase Spark 3.x" (scala 2.13; the 2.12 one was cancelled by fail-fast), while this PR only touches paimon-core compaction. The same workflow on master shows 4 failures in the last 8 runs, so it looks flaky. Could you help re-trigger the CI? Thanks! |
Contributor
Author
|
@JingsongLi Could you help re-trigger the failed CI job when you have a moment? It appears to be a flaky Spark 3.x test suite unrelated to this change (details above). Thanks! |
Contributor
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fixes #8778.
When a full compaction finds a bucket containing only max-level files,
CompactStrategy.pickFullCompactionpicks the files carrying deletion vectors and builds aCompactUnitwithfileRewrite=true, which is executed byFileRewriteCompactTask.Inside the task the rewriter correctly calls
notifyRewriteCompactBefore→dvMaintainer.removeDeletionVectorOf(...)for every rewritten file, so the maintainer's in-memory state is updated. However, unlikeMergeTreeCompactTask,FileRewriteCompactTasknever received thecompactDfSupplierand never calledresult.setDeletionFile(...), so the updated deletion-vector index was never written or attached to theCompactResult. The commit then contained no index-manifest change for this bucket, andIndexManifestFileHandlerkept the previous (now stale) DV entry — an orphan entry pointing to data files that no longer exist.This was introduced by #5751 which extracted
FileRewriteCompactTaskfrom the old code path but dropped thecompactDfSupplierhandling.This PR passes
compactDfSupplierintoFileRewriteCompactTaskand callsresult.setDeletionFile(compactDfSupplier.get())at the end ofdoCompact(), mirroringMergeTreeCompactTask.Tests
Added
DeletionVectorIndexCleanupTest#testFullCompactionCleansDvIndex, which reproduces the write-only + standalone compaction pipeline:-Drows → L0The test fails on current master and passes with this fix. Also ran
*Compact*Test/DeletionVector*Test/*DeletionVectors*Testin paimon-core (136 tests) — all green.API and Format
No public API or storage format change. Only metadata hygiene: the consumed DV index entries are now correctly removed by the commit of the full compaction.
Documentation
N/A