Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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

1 participant