You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Chung-En Lee (Jira)" <ji...@apache.org> on 2026/08/23 21:09:00 UTC

[jira] [Resolved] (HDDS-16212) Avoid the per-group list copy in Recon ContainerKeyMapperHelper

     [ https://issues.apache.org/jira/browse/HDDS-16212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chung-En Lee resolved HDDS-16212.
---------------------------------
    Resolution: Fixed

> Avoid the per-group list copy in Recon ContainerKeyMapperHelper
> ---------------------------------------------------------------
>
>                 Key: HDDS-16212
>                 URL: https://issues.apache.org/jira/browse/HDDS-16212
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: Huang Kuan Hao
>            Assignee: Huang Kuan Hao
>            Priority: Major
>              Labels: pull-request-available
>
> 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.
> Fix: iterate getLocationLists() (returns locationVersionMap.values() with no copy) with a nested loop. All sinks are container/version-keyed map operations, so element order is irrelevant. Behavior unchanged.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org