Skip to content

HDDS-16212. Avoid the per-group list copy in Recon ContainerKeyMapperHelper - #11058

Open
rich7420 wants to merge 1 commit into
apache:masterfrom
rich7420:HDDS-16212
Open

HDDS-16212. Avoid the per-group list copy in Recon ContainerKeyMapperHelper#11058
rich7420 wants to merge 1 commit into
apache:masterfrom
rich7420:HDDS-16212

Conversation

@rich7420

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

ContainerKeyMapperHelper.handleKeyReprocess and handlePutOMKeyEvent iterate getLocationList() for every version group, but the loop body only reads getContainerID():

for (OmKeyLocationInfoGroup omKeyLocationInfoGroup : omKeyInfo.getKeyLocationVersions()) {
long keyVersion = omKeyLocationInfoGroup.getVersion();
for (OmKeyLocationInfo omKeyLocationInfo : omKeyLocationInfoGroup.getLocationList())

{ long containerId = omKeyLocationInfo.getContainerID(); ... }
}
getLocationList() is documented as not O(1); it flatten-copies into a new List. handleKeyReprocess runs over the entire OM key table during Recon reprocess (ParallelTableIteratorOperation), so a list is allocated per version group per key across the whole keyspace.

What is the link to the Apache JIRA

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

How was this patch tested?

https://github.com/rich7420/ozone/actions/runs/32219894034

…Helper

handlePutOMKeyEvent and handleKeyReprocess iterated getLocationList() for
every version group, allocating a flattened list per group per key. The loop
bodies only read getContainerID(), so iterate getLocationLists() (the backing
locationVersionMap.values() view) with a nested loop and drop the allocation.
handleKeyReprocess runs over the entire OM key table during Recon reprocess,
so this removes one throwaway list per version group across the whole keyspace.
Copilot AI lite review requested due to automatic review settings August 19, 2026 05:35

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sarvekshayr sarvekshayr 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 @rich7420 for working on this.

LGTM.

@sarvekshayr

Copy link
Copy Markdown
Contributor

@chungen0126 and @yandrey321, would you like to take a look?

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.

3 participants