Skip to content

Conversation

@tanvipenumudy
Copy link
Contributor

@tanvipenumudy tanvipenumudy commented Jul 15, 2025

What changes were proposed in this pull request?

Recon OmTableHandlers currently rely on the full KeyInfo proto for key metadata. However, most of the fields in OMKeyInfo, such as KeyLocationList, FileEncryptionInfoProto, OzoneAclInfo, and FileChecksumProto, are not required and contribute to unnecessary serialization and deserialization overhead.

This inefficiency becomes significant for larger keys or multipart upload (MPU) keys, where the KeyLocationList can be very large. As a result, this can cause performance degradation for clients querying this API.

To address this, OMKeyInfo objects should be replaced with a lighter weight ReconBasicOmKeyInfo object (based on the KeyInfoProtoLight proto) introduced in PR #8699. This lightweight version includes only the necessary fields required for event handling.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-13442

How was this patch tested?

@tanvipenumudy tanvipenumudy changed the base branch from master to HDDS-13177 July 15, 2025 08:35
Copy link
Contributor

@devabhishekpal devabhishekpal left a comment

Choose a reason for hiding this comment

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

Thanks for this change @tanvipenumudy
LGTM, +1

@devmadhuu @ArafatKhan2198 could you take a look as well?

Copy link
Contributor

@ArafatKhan2198 ArafatKhan2198 left a comment

Choose a reason for hiding this comment

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

Thanks, Tanvi! Most of the changes look great. Could you please add a brief JavaDoc comment at the beginning?

Additionally, the code would benefit from more comprehensive documentation explaining the relationship between OmKeyInfo and ReconBasicOmKeyInfo. Please add class-level JavaDoc to clarify this.

Copy link
Contributor

@devmadhuu devmadhuu left a comment

Choose a reason for hiding this comment

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

@tanvipenumudy Thanks for the patch, one comment. Pls check.

return builder.build();
}

public static ReconBasicOmKeyInfo getFromProtobuf(OzoneManagerProtocolProtos.KeyInfo keyInfoProto) {
Copy link
Contributor

@devmadhuu devmadhuu Jul 16, 2025

Choose a reason for hiding this comment

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

Any reason this method is duplicated ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the existing method takes OzoneManagerProtocolProtos.KeyInfoProtoLight as an argument while the new overloaded method takes OzoneManagerProtocolProtos.KeyInfo as an argument!

Copy link
Contributor

Choose a reason for hiding this comment

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

I see that since PartKeyInfo is using KeyInfo proto and even though you are not using keylocations and other fields, these fields will still be decoded from byte buffer to proto fields. Is this Ok ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct, the PR only addresses one half of the issue with performance.

PartKeyInfo is using KeyInfo proto and even though you are not using keylocations and other fields, these fields will still be decoded from byte buffer to proto fields

To optimize this further, we may need a new implementation of PartKeyInfoMap that uses an updated version of Iterable based on the KeyInfoProtoLight proto object instead of KeyInfo. However, this could require significant changes, not sure if there's a good way to handle this!

cc: @sumitagrawl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed offline, created the ticket: HDDS-13490 for addressing the remaining portion of the optimization!

@tanvipenumudy
Copy link
Contributor Author

Please add class-level JavaDoc to clarify this.

Thank you @ArafatKhan2198 for the review! I believe this is already addressed in PR: #8699, that introduces the ReconBasicOmKeyInfo class. I have added a JavaDoc to the newly introduced method with the relevant details.

@tanvipenumudy tanvipenumudy requested a review from ChenSammi July 17, 2025 17:05
Copy link
Contributor

@priyeshkaratha priyeshkaratha left a comment

Choose a reason for hiding this comment

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

Thanks for this change @tanvipenumudy. Changes looks good for me.

@tanvipenumudy
Copy link
Contributor Author

Thank you @devabhishekpal, @devmadhuu, @priyeshkaratha and @ArafatKhan2198 for reviewing the patch!

@tanvipenumudy tanvipenumudy merged commit 4a9cce4 into apache:HDDS-13177 Jul 22, 2025
117 of 137 checks passed
priyeshkaratha pushed a commit to priyeshkaratha/ozone that referenced this pull request Nov 5, 2025
priyeshkaratha pushed a commit to priyeshkaratha/ozone that referenced this pull request Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants