Skip to content

HDDS-16037. Support Storage Tier per pipeline in Ozone Admin Datanode List Command - #11066

Open
anuragp010 wants to merge 1 commit into
apache:HDDS-11233from
anuragp010:hdds-16037
Open

HDDS-16037. Support Storage Tier per pipeline in Ozone Admin Datanode List Command#11066
anuragp010 wants to merge 1 commit into
apache:HDDS-11233from
anuragp010:hdds-16037

Conversation

@anuragp010

@anuragp010 anuragp010 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The command ozone admin datanode list includes all the pipelines a given node is part of. But, the supported storageTier of every pipeline is not displayed. This PR adds the supported storageTier when printing related pipelines.

What is the link to the Apache JIRA

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

How was this patch tested?

  1. Unit Test
  2. Functional validation:
bash-5.1$ ozone admin datanode list
Datanode: 930e5429-88e2-4575-91f1-09dd5693bcc3 (/default-rack/172.18.0.9/ozone-datanode-disk-2.ozone_default/2 pipelines)
Operational State: IN_SERVICE
Health State: HEALTHY
Total volume count: 1
Healthy volume count: 1
Related pipelines:
d9b3eb02-9447-4558-a7e3-6a5b57da95ed/RATIS/THREE/RATIS/ALLOCATED/Follower/[DISK]
42f4899f-5db9-445d-81a0-2c65ba7ad6a2/RATIS/ONE/RATIS/OPEN/Leader/[DISK]

Datanode: dbab6522-e04b-4951-ad47-c26c0f4bd5c6 (/default-rack/172.18.0.8/ozone-datanode-disk-1.ozone_default/2 pipelines)
Operational State: IN_SERVICE
Health State: HEALTHY
Total volume count: 1
Healthy volume count: 1
Related pipelines:
d9b3eb02-9447-4558-a7e3-6a5b57da95ed/RATIS/THREE/RATIS/ALLOCATED/Follower/[DISK]
c4326157-5f26-44d2-bdf1-4117a7e91c46/RATIS/ONE/RATIS/OPEN/Leader/[DISK]

Datanode: 404f9115-040b-4f91-a1e5-13f681299be7 (/default-rack/172.18.0.6/ozone-datanode-disk-3.ozone_default/2 pipelines)
Operational State: IN_SERVICE
Health State: HEALTHY
Total volume count: 1
Healthy volume count: 1
Related pipelines:
d9b3eb02-9447-4558-a7e3-6a5b57da95ed/RATIS/THREE/RATIS/ALLOCATED/Follower/[DISK]
b9e88083-19ac-4e1b-9390-9672c817d65f/RATIS/ONE/RATIS/OPEN/Leader/[DISK]

Generated using Cursor

}

@ParameterizedTest
@EnumSource(value = StorageTier.class, names = {"EMPTY"}, mode = EnumSource.Mode.EXCLUDE)

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.

Why exclude EMPTY? EMPTY.getTierName() is "EMPTY", so an EMPTY-tier pipeline prints /[EMPTY] (not /[] like null). If that value is reachable, is /[EMPTY] the intended output or should it render like null? Either way, worth covering it rather than excluding.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rich7420 , thanks for taking a look !

I initially left StorageTier.EMPTY out of testRelatedPipelineShowsStorageTier because it shouldn't be reachable on the client side. Specifically because:

  1. Pipeline creation prevents it (RatisPipelineProvider and SimplePipelineProvider use StorageTierUtil.validateNotEmpty).
  2. Serialization would fail (listPipelines calling pipeline.getProtobufMessage() in StorageContainerLocationProtocolServerSideTranslatorPB triggers StorageTier.toProto(), which throws an IllegalStateException for EMPTY).

Given that it's an unreachable state, do you think it's still worth adding handling and a test case for EMPTY?

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.

Agreed — EMPTY isn't reachable as a pipeline tier (providers validate non-EMPTY or set null on create, and fromProto only yields SSD/DISK/ARCHIVE), so excluding it is correct. The reachable case, null, is already covered by testRelatedPipelineOmitsTierWhenNull. Nothing to change here.

@rich7420

Copy link
Copy Markdown
Contributor

@anuragp010 thanks for the patch!

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.

3 participants