Skip to content

HDDS-15242. Container report support StorageType#10380

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

HDDS-15242. Container report support StorageType#10380
xichen01 wants to merge 1 commit into
apache:HDDS-11233from
xichen01:HDDS-15242

Conversation

@xichen01
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Support for Datanode to report the StorageType of container replicas to SCM

  • Subsequently, SCM will determine whether the container replica needs to be migrated based on the ContainerReplicaStorageType, and verify whether the storage policy for the key is satisfied.

What is the link to the Apache JIRA

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

How was this patch tested?

New tests.

@xichen01
Copy link
Copy Markdown
Contributor Author

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

@greenwich
Copy link
Copy Markdown
Contributor

greenwich commented May 29, 2026

Thanks! LGTM with one note though:

It's not directly related to this PR: StorageTypeUtils.getStorageTypeProto throws an unchecked IllegalArgumentException for any org.apache.hadoop.fs.StorageType it doesn't map. With Hadoop 3.4.3 that enum includes NVDIMM, which StorageTypeProto doesn't cover, and StorageLocation.parse accepts an [NVDIMM]/... entry in hdds.datanode.dir with no Ozone-side filtering. So a datanode with such a volume would throw here on every buildContainerReplicaProto, breaking that DN's container report.

@xichen01
Copy link
Copy Markdown
Contributor Author

Thanks! LGTM with one note though:

It's not directly related to this PR: StorageTypeUtils.getStorageTypeProto throws an unchecked IllegalArgumentException for any org.apache.hadoop.fs.StorageType it doesn't map. With Hadoop 3.4.3 that enum includes NVDIMM, which StorageTypeProto doesn't cover, and StorageLocation.parse accepts an [NVDIMM]/... entry in hdds.datanode.dir with no Ozone-side filtering. So a datanode with such a volume would throw here on every buildContainerReplicaProto, breaking that DN's container report.

@greenwich

Thank you for your feedback. This is a vulnerability that needs to be fixed.

I'm considering whether to use Hadoop's org.apache.hadoop.fs.StorageType in Ozone. Perhaps we should define a custom org.apache.ozone.fs.StorageType.
Currently, using org.apache.hadoop.fs.StorageType doesn't seem to offer any benefits. Hadoop's org.apache.hadoop.fs.FileSystem only uses StorageType in setQuotaByStorageType, and Ozone may not be compatible with this interface.
If we define a custom StorageType, we can set the enum content more flexibly.


By the way, have you guys tried using the Storage Policy feature internally yet?

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.

2 participants