Skip to content

HDDS-15440. Combine pipelineMap and pipeline2container to a single map in PipelineStateMap#10454

Open
omkenge wants to merge 25 commits into
apache:masterfrom
omkenge:HDDS-15440-fix
Open

HDDS-15440. Combine pipelineMap and pipeline2container to a single map in PipelineStateMap#10454
omkenge wants to merge 25 commits into
apache:masterfrom
omkenge:HDDS-15440-fix

Conversation

@omkenge

@omkenge omkenge commented Jun 6, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

HDDS-15440. Combine pipeline metadata and container mappings into a single map

This patch refactors PipelineStateMap by combining the existing pipelineMap and pipeline2container data structures into a single map that stores both the Pipeline object and its associated container information.

Previously, PipelineStateMap maintained two separate maps keyed by PipelineID:

Map<PipelineID, Pipeline> pipelineMap
Map<PipelineID, NavigableSet<ContainerID>> pipeline2container

Maintaining related information in separate maps increased code complexity and introduced the possibility of the two maps becoming inconsistent. This patch introduces a unified data structure that encapsulates both the pipeline metadata and its container set, ensuring that all pipeline-related state is managed together.

The change simplifies state management, improves maintainability, and reduces the risk of synchronization issues between multiple maps while preserving the existing behavior of PipelineStateMap.

What is the link to the Apache JIRA

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

How was this patch tested?

The patch was tested by:

  • Running the existing PipelineStateMap unit tests.
  • Verifying that pipelines can be added, retrieved, and removed successfully after the refactoring.
  • Verifying that container mappings associated with a pipeline are correctly maintained through add/remove operations.
  • Building and running the SCM module tests to ensure there are no regressions caused by the internal data structure change.

No functional behavior changes were introduced; the patch is a refactoring focused on improving the internal implementation of PipelineStateMap.

szetszwo and others added 3 commits May 30, 2026 18:37
HDDS-15440. Combine pipelineMap and pipeline2container to a single ma…
@omkenge

omkenge commented Jun 8, 2026

Copy link
Copy Markdown
Author

Cc @adoroszlai

@adoroszlai adoroszlai changed the title Hdds 15440 fix - Combine pipelineMap and pipeline2container to a single map in PipelineStateMap HDDS-15440. Combine pipelineMap and pipeline2container to a single map in PipelineStateMap Jun 9, 2026
@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks @omkenge for the patch. Please enable the build-branch workflow in your fork.

@omkenge

omkenge commented Jun 9, 2026

Copy link
Copy Markdown
Author

@adoroszlai Done

@omkenge

omkenge commented Jun 12, 2026

Copy link
Copy Markdown
Author

CC @szetszwo

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

+1 the change looks good.

@omkenge

omkenge commented Jun 13, 2026

Copy link
Copy Markdown
Author

CC @sumitagrawl

@ivandika3

Copy link
Copy Markdown
Contributor

@omkenge Please check the failing tests.

@omkenge

omkenge commented Jun 17, 2026

Copy link
Copy Markdown
Author

CC @ivandika3 @sumitagrawl

@adoroszlai adoroszlai marked this pull request as draft June 17, 2026 05:40
@ivandika3

ivandika3 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

@omkenge The test failures do not seem transient (https://github.com/omkenge/ozone/actions/runs/27664987145). PTAL.

@adoroszlai

Copy link
Copy Markdown
Contributor

retrigger after transient failures

The failures are not transient. Please fix them instead of simply retriggering CI.

To find the problem, you can download test logs from https://github.com/omkenge/ozone/actions/runs/27664987145 (see Artifacts at the bottom).

There is at least one big problem that fails all tests that write any data:

java.lang.UnsupportedOperationException
	at java.base/java.util.Collections$UnmodifiableCollection.removeAll(Collections.java:1105)
	at org.apache.hadoop.hdds.scm.container.ContainerManagerImpl.getMatchingContainer(ContainerManagerImpl.java:381)
	at org.apache.hadoop.hdds.scm.pipeline.WritableRatisContainerProvider.selectContainer(WritableRatisContainerProvider.java:184)
	at org.apache.hadoop.hdds.scm.pipeline.WritableRatisContainerProvider.getContainer(WritableRatisContainerProvider.java:154)
	at org.apache.hadoop.hdds.scm.pipeline.WritableRatisContainerProvider.getContainer(WritableRatisContainerProvider.java:83)
	at org.apache.hadoop.hdds.scm.pipeline.WritableContainerFactory.getContainer(WritableContainerFactory.java:72)
	at org.apache.hadoop.hdds.scm.block.BlockManagerImpl.allocateBlock(BlockManagerImpl.java:163)

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

@omkenge , thanks for the update!

@omkenge omkenge marked this pull request as ready for review June 22, 2026 17:46
@omkenge

omkenge commented Jun 22, 2026

Copy link
Copy Markdown
Author

CC @ivandika3 @szetszwo
Thanks for Your patience :)

@omkenge

omkenge commented Jun 24, 2026

Copy link
Copy Markdown
Author

Cc @sumitagrawl

@omkenge omkenge requested a review from szetszwo June 25, 2026 09:26
@szetszwo

Copy link
Copy Markdown
Contributor

@omkenge , Now we are copying in all cases.

Could you take a look at this #10454 (comment) ?

@omkenge

omkenge commented Jun 26, 2026

Copy link
Copy Markdown
Author

cc @szetszwo
Open for guidance and suggestions:)

@omkenge

omkenge commented Jun 26, 2026

Copy link
Copy Markdown
Author

@szetszwo It would be great if you can guide me on failing CI

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.

4 participants