Skip to content

HDDS-15250. PipelineProvider support create pipeline by StorageTier#10410

Open
xichen01 wants to merge 1 commit into
apache:HDDS-11233from
xichen01:HDDS-15250
Open

HDDS-15250. PipelineProvider support create pipeline by StorageTier#10410
xichen01 wants to merge 1 commit into
apache:HDDS-11233from
xichen01:HDDS-15250

Conversation

@xichen01

@xichen01 xichen01 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • Support creating pipelines on a specific StorageTier for Ratis, EC, and Standalone provider paths(see: PipelineProvider#create subclass ).
  • PlacementPolicy#chooseDatanodes support StorageType, so datanodes are selected only when the matching StorageType has enough space.
  • Add StorageTier ID helpers and NVDIMM protobuf mapping.
  • For interfaces that do not currently support StorageTier/StorageType, use the default StorageTier/StorageType (such as PipelineFactory#create)

FYI:

What is the link to the Apache JIRA

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

How was this patch tested?

Newly added test

@xichen01

xichen01 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@greenwich @chungen0126 @ivandika3 @peterxcli Please help to review

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

Thanks @xichen01 , left first review.

Comment on lines +164 to +166
public static void setDefault(StorageTier storageTier) {
defaultTier = storageTier;
}

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.

Does not seem to be used, should be configured and set in StorageContainerManager.java

Comment on lines +38 to +41
if (storageTier.equals(StorageTier.EMPTY)) {
throw new SCMException("Cannot create Pipeline for empty tier",
SCMException.ResultCodes.CANNOT_CREATE_PIPELINE_FOR_EMPTY_TIER);
}

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.

Nullity check here?

protected abstract Pipeline create(REPLICATION_CONFIG replicationConfig)
throws IOException;
protected abstract Pipeline create(REPLICATION_CONFIG replicationConfig,
StorageTier storageTier) throws IOException;

@amaliujia amaliujia Jun 4, 2026

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.

Could StorageTier be part of REPLICATION_CONFIG so we do not need to change abstract interface here?

private final boolean isUniform;
private static final Map<StorageTier, Map<Integer, List<StorageType>>>
CACHE = new EnumMap<>(StorageTier.class);
public static final int MAX_NODE_COUNT = 20;

@greenwich greenwich Jun 5, 2026

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.

MAX_NODE_COUNT = 20 is undocumented and, because getStorageTypes(int) throws on a cache miss, it effectively silently caps replication width.

For uniform tiers, computeStorageTypes is just Collections.nCopies(...) (O(1)), so the cache isn't buying anything — suggest dropping it:

  public List<StorageType> getStorageTypes(int nodeCount) {
    return computeStorageTypes(nodeCount);
  }

I checked that later fromID/computeId/findSupportedStorageTiers work — none of it needs this cache (only the StorageType→prime table + computeId), so dropping it entirely is safe.

(Or, if you'd rather keep the precompute: fall through to computeStorageTypes(nodeCount) on a miss, document MAX_NODE_COUNT, and make it private.)

* @param defaultContainerSize The cluster default max container size
* @param container The container to select new replicas for
* @param container The container to select new replicas for
* @param storageType

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.

nit: empty storageType param

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.

4 participants