Skip to content

HDDS-12655. Optimize Recon Container Mismatch API while getting containerInfos & ContainerMetadata. - ( OM Changes )#8855

Closed
ArafatKhan2198 wants to merge 1 commit intoapache:masterfrom
ArafatKhan2198:HDDS-12655-OM-Changes
Closed

HDDS-12655. Optimize Recon Container Mismatch API while getting containerInfos & ContainerMetadata. - ( OM Changes )#8855
ArafatKhan2198 wants to merge 1 commit intoapache:masterfrom
ArafatKhan2198:HDDS-12655-OM-Changes

Conversation

@ArafatKhan2198
Copy link
Contributor

What changes were proposed in this pull request?

The existing mismatch API was inefficient because it looked into the containerKeyPrefix table for all containers, which required examining many more keys than necessary. This was especially problematic when only checking for container presence rather than needing full container metadata. The original approach used complex dual-iterator logic with sorting and comparison operations, leading to poor performance and unnecessary deserialization.

Proposed Changes

  1. Removed peekNextKey() Functionality
    The pull request removes the peekNextKey() method from the SeekableIterator interface and updates the ContainerMetadataIterator to remove peek functionality. The ContainerEndpoint logic was modified to use simple next() calls instead of peek operations, and the corresponding test method testContainerIteratorPeekNextKey() was removed.
  2. Completely Overhauled SCM Case Logic
    The SCM case (missing in SCM - data loss scenario) was completely rewritten following reviewer feedback. The old approach used complex dual-iterator logic with sorting and comparison operations. The new approach loads all SCM containers into a HashMap for fast O(1) lookups, then iterates over OM containers using only the containerKeyCountTable to avoid unnecessary deserialization. This eliminates the need for complex iterator comparisons and seeking operations.

What is the link to the Apache JIRA

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

How was this patch tested?

Unit tests

@ArafatKhan2198 ArafatKhan2198 changed the title HDDS-12655. Optimize Recon Container Mismatch API while getting containerInfos & ContainerMetadata. HDDS-12655. Optimize Recon Container Mismatch API while getting containerInfos & ContainerMetadata. - ( OM Changes ) Jul 23, 2025
@ArafatKhan2198 ArafatKhan2198 force-pushed the HDDS-12655-OM-Changes branch from c1d134a to c42df75 Compare August 4, 2025 08:22
@github-actions
Copy link

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

@github-actions github-actions bot added the stale label Nov 11, 2025
@github-actions
Copy link

Thank you for your contribution. This PR is being closed due to inactivity. If needed, feel free to reopen it.

@github-actions github-actions bot closed this Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant