HDDS-14432. SnapshotDeletingService incorrectly checks Ratis Buffer Limit#9656
Merged
smengcl merged 4 commits intoapache:masterfrom Feb 5, 2026
Merged
HDDS-14432. SnapshotDeletingService incorrectly checks Ratis Buffer Limit#9656smengcl merged 4 commits intoapache:masterfrom
smengcl merged 4 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes incorrect Ratis buffer limit checking in SnapshotDeletingService. The old implementation would add all snapshot-related entries to a request builder before checking if the message size exceeded the buffer limit, then attempted to recover by truncating the lists. This approach was flawed as it could create oversized messages.
Changes:
- Replaced the flawed size-checking logic with progressive batch building that checks size limits before adding each entry
- Introduced proper batching across deletedKeys, renamedKeys, and deletedDirs with early termination on failures
- Improved error handling by returning the count of successfully submitted entries for accurate retry tracking
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.../ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/SnapshotDeletingService.java
Outdated
Show resolved
Hide resolved
.../ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/SnapshotDeletingService.java
Show resolved
Hide resolved
smengcl
reviewed
Jan 24, 2026
.../ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/SnapshotDeletingService.java
Show resolved
Hide resolved
smengcl
approved these changes
Jan 27, 2026
Contributor
smengcl
left a comment
There was a problem hiding this comment.
lgtm. Could you add a test case for this fix? (which would have failed without this fix)
Member
Author
|
@smengcl Thanks for the review. I have added test for this. |
Contributor
|
Awesome. Thanks @aswinshakil |
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.
What changes were proposed in this pull request?
SnapshotDeletingServiceincorrectly checks the Ratis Buffer Limit when we invokesubmitSnapshotMoveDeletedKeys, it adds all the keys to the builder and then checks the size of the message. Later, it again adds moredeletedKeys,deletedDirsandrenamedKeyson it, The message size is already over the ratis buffer limit, instead of creating a new builder we re-use the same builder. Ideally we should stop iterating through the snapshot-related tables when we hit the buffer limit even before going tosubmitSnapshotMoveDeletedKeysWhat is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14432
How was this patch tested?
Existing Tests