Skip to content

HDDS-16253. Fix getPipelines() in Recon always returning an empty pipeline list - #11090

Open
shuan1026 wants to merge 1 commit into
apache:masterfrom
shuan1026:HDDS-16253
Open

HDDS-16253. Fix getPipelines() in Recon always returning an empty pipeline list#11090
shuan1026 wants to merge 1 commit into
apache:masterfrom
shuan1026:HDDS-16253

Conversation

@shuan1026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

ReconContainerMetadataManagerImpl#getPipelines(ContainerKeyPrefix) builds a nested Stream pipeline to collect the Pipelines for a key's block locations, but both .stream().map(...) calls are intermediate operations with no terminal operation attached. Because Java streams are lazily evaluated, the pipelines.add(...) is never actually executed, so the method unconditionally returns the empty ArrayList created at the top of the method.

This method is the only implementation backing ContainerMetadataIterator#next(), which is used by ReconContainerMetadataManager#getContainersIterator(). That iterator feeds two REST endpoints in ContainerEndpoint: GET /containers/mismatch and GET /containers/mismatch/deleted. Both currently return "pipelines": [] for every container, even when the container's key actually has valid pipeline data in OM.

This PR replaces the two dangling .stream().map(...) chains with .forEach(...)

What is the link to the Apache JIRA

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

How was this patch tested?

  • Ran the existing TestReconContainerMetadataManagerImpl: 15/15 tests pass.

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.

1 participant