Skip to content

HDDS-15783. Handle empty lists in ScmListCodec deserialization#10690

Merged
adoroszlai merged 3 commits into
apache:masterfrom
priyeshkaratha:HDDS-15783
Jul 10, 2026
Merged

HDDS-15783. Handle empty lists in ScmListCodec deserialization#10690
adoroszlai merged 3 commits into
apache:masterfrom
priyeshkaratha:HDDS-15783

Conversation

@priyeshkaratha

Copy link
Copy Markdown
Contributor

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.Object and 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 says

What 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

@adoroszlai adoroszlai requested review from Russole and szetszwo July 8, 2026 12:45

@szetszwo szetszwo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@priyeshkaratha , thanks for fixing the bug! Please see the comment inlined.

@priyeshkaratha priyeshkaratha requested a review from szetszwo July 8, 2026 16:55
@priyeshkaratha

Copy link
Copy Markdown
Contributor Author

@szetszwo @adoroszlai are we good to merge this PR?

@Russole Russole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @priyeshkaratha for the patch. I have left a comment.

@priyeshkaratha

Copy link
Copy Markdown
Contributor Author

@szetszwo @Russole Thanks for the reviews. I have addressed all the comments in latest commit.

@priyeshkaratha priyeshkaratha requested a review from Russole July 9, 2026 07:58
@adoroszlai adoroszlai merged commit 2a05dc0 into apache:master Jul 10, 2026
86 of 89 checks passed
@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks @priyeshkaratha for the patch, @Russole, @szetszwo for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants