arunsarin85 opened a new pull request, #11094: URL: https://github.com/apache/ozone/pull/11094
## What changes were proposed in this pull request? - Adds TestOmSnapshotDefragSpaceSavings, a new integration test class validating that snapshot defrag reduces checkpoint disk footprint. - Covers OBS and FSO bucket layouts, full vs incremental defrag paths, middle-snapshot purge with re-defrag, single-snapshot full defrag, and repeated defrag idempotency. Please describe your PR in detail: Added correctness coverage in TestOmSnapshotCheckpointDbContent; this PR adds space savings / footprint coverage in a separate test class. Measurement approach - Version-0 checkpoints hardlink to AOS SST files, so their on-disk byte totals are not comparable to materialized post-defrag checkpoints. - Savings are validated by cross-snapshot SST reference reduction: duplicate-inclusive pre-defrag totals (each snapshot counted independently) vs inode-deduped post-defrag chain totals. - Footprint helpers mirror OMSnapshotDirectoryMetrics inode deduplication so hardlinked SSTs are not double-counted across snapshot dirs. Test scenarios (4 tests) | Test | Scenario | | :--- | :--- | | `testSnapshotDefragReducesCheckpointFootprintWithChurn` | Three-snapshot chain (`S1`/`S2`/`S3`) with AOS `compactDB()` plus insert/overwrite/delete churn. Runs on OBS, then after `restartCluster()` on FSO. Asserts SST redundancy drops after defrag. OBS pass also verifies one full defrag (chain head) and two incremental defrags (`S2`, `S3`) via `OmSnapshotInternalMetrics` and `pathPreviousSnapshotId`. | | `testObsSnapshotDefragReducesFootprintAfterMiddleSnapshotPurge` | After initial defrag on a three-snapshot OBS chain, deletes middle snapshot `S2`, waits for purge, triggers follow-up defrag on `S3`. Asserts `S3` footprint does not grow materially and the remaining `S1`+`S3` chain footprint shrinks vs the original three-snapshot chain. | | `testObsSingleSnapshotFullDefragReducesCheckpointFootprint` | Lone OBS snapshot with churn runs the full defrag path: version advances to 1, `v0` checkpoint dir is removed, defrag completes (`needsDefrag=false`). | | `testObsRepeatedDefragDoesNotIncreaseCheckpointFootprint` | Second defrag pass on an already-defragged three-snapshot OBS chain is idempotent: bytes, SST count, and snapshot local-data versions unchanged. | ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-13218 (Parent epic: https://issues.apache.org/jira/browse/HDDS-13003) ## How was this patch tested? https://github.com/arunsarin85/ozone/actions/runs/32661013503 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
