HDDS-15783. Handle empty lists in ScmListCodec deserialization#10690
Merged
Conversation
szetszwo
reviewed
Jul 8, 2026
szetszwo
left a comment
Contributor
There was a problem hiding this comment.
@priyeshkaratha , thanks for fixing the bug! Please see the comment inlined.
Contributor
Author
|
@szetszwo @adoroszlai are we good to merge this PR? |
Russole
reviewed
Jul 9, 2026
Russole
left a comment
Contributor
There was a problem hiding this comment.
Thanks @priyeshkaratha for the patch. I have left a comment.
Contributor
Author
Contributor
|
Thanks @priyeshkaratha for the patch, @Russole, @szetszwo for the review. |
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?
When SCM serializes an empty List into a Ratis log entry, ScmListCodec.serialize writes a ListArgument proto with type =
java.lang.Objectand zero value entries (the EMPTY_LIST sentinel). On replay (follower sync or SCM restart), the old deserialize path unconditionally called resolver.get("java.lang.Object"), which threw InvalidProtocolBufferException: Failed to resolve java.lang.Object because Object is not a registered SCM codec type. The guard short-circuits as soon as it sees zero value entries and returns an empty ArrayList directly, which is the correct result regardless of what the sentinel type string saysWhat is the link to the Apache JIRA
HDDS-15783
How was this patch tested?
Tested using unit test and tested the environment applying the patch