HDDS-15860. Always rewrite live SSTs before snapshot defrag ingestion#10772
Draft
smengcl wants to merge 3 commits into
Draft
HDDS-15860. Always rewrite live SSTs before snapshot defrag ingestion#10772smengcl wants to merge 3 commits into
smengcl wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes incremental snapshot defragmentation behavior in Ozone Manager by removing the “single delta file + version > 0” fast path that directly ingested candidate SSTs. Instead, it always rewrites candidate SST sets into a freshly generated external SST containing the logical delta (including prefix filtering, snapshot value comparison, and tombstones) before ingestion into the checkpoint DB.
Changes:
- Removed the single-file direct-ingestion shortcut in
performIncrementalDefragmentation, always routing throughspillTableDiffIntoSstFile. - Updated the existing incremental-defrag unit test expectations to require rewriting regardless of snapshot version / delta-file count.
- Added a new parameterized regression-style test to cover “live SST” ingestion scenarios (DB-generated vs previously-ingested SST candidates).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/defrag/SnapshotDefragService.java |
Removes direct ingestion of single delta-file candidates; always rebuilds a logical external SST delta before ingestion. |
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/defrag/TestSnapshotDefragService.java |
Updates expectations to always rewrite and adds a new regression test for single-live-SST candidate handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Generated-by: Codex (GPT-5.6 Sol)
What changes were proposed in this pull request?
Incremental snapshot defragmentation directly ingested a candidate SST when a table had exactly one delta file and the snapshot version was greater than zero.
These candidate files are live RocksDB SSTs selected at file granularity, not external SSTs containing an exact logical bucket delta. A DB-generated SST is rejected by external-file ingestion, while a previously ingested live SST may be accepted but apply the wrong value. Direct ingestion also bypasses bucket-prefix filtering, snapshot value comparison, and tombstone generation.
This change removes the single-file shortcut. All candidate SST sets now pass through
spillTableDiffIntoSstFile, which constructs a fresh external SST containing the logical differences between the current and previous snapshots.The existing incremental-defragmentation test is updated to expect rewriting regardless of snapshot version or candidate-file count. A new real-RocksDB regression test covers both DB-generated SSTs and SSTs previously ingested into a live database.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15860
How was this patch tested?
Before the production change, the new regression reproduced both failure modes:
External file version not found.After the change:
TestSnapshotDefragService: 23 tests passed../hadoop-ozone/dev-support/checks/checkstyle.sh: passed across all 59 modules.ozone-managermodule and its dependencies compiled successfully.