Skip to content

HDDS-15872. Ozone Bucket Support StoragePolicy and allowFallbackStoragePolicy. - #11192

Open
devmadhuu wants to merge 3 commits into
apache:HDDS-11233from
devmadhuu:HDDS-15872
Open

HDDS-15872. Ozone Bucket Support StoragePolicy and allowFallbackStoragePolicy.#11192
devmadhuu wants to merge 3 commits into
apache:HDDS-11233from
devmadhuu:HDDS-15872

Conversation

@devmadhuu

@devmadhuu devmadhuu commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR is to add storagePolicy and allowFallbackStoragePolicy as first-class bucket properties. The two fields flow end-to-end from the client into the OM bucket record, through OmBucketInfo / OmBucketArgs serialization, and out again into recon and s3g stubs. The legacy hadoop.hdds.protocol.StorageType wrapper enum is removed from the client-side bucket API surface, but the storageType wire field is retained (as deprecated) for backward
compatibility with older peers — see below.

This is the client / OM-side data-model change only. There will be follow up PRs which will replace the current OzoneStoragePolicy.getDefaultPolicy() hard-coded default in OMKeyRequest.allocateBlock.

Protocol

hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto:

  • BucketInfo: added optional hadoop.hdds.StoragePolicyProto storagePolicy = 24; and optional bool allowFallbackStoragePolicy = 25;. The pre-existing storageType = 5 field is kept, marked [deprecated = true, default = DISK] and downgraded from required to optional for wire compatibility (see next section).
  • BucketArgs: added optional hadoop.hdds.StoragePolicyProto storagePolicy = 14; and optional bool allowFallbackStoragePolicy = 15;. The pre-existing storageType = 6 is retained as optional [deprecated = true].

Both changes pass proto-backwards-compatibility (protolock).

Deleted

  • hadoop-ozone/common/src/main/java/org/apache/hadoop/hdds/protocol/StorageType.java is removed. The Datanode-facing hadoop.hdds.protocol.proto.HddsProtos.StorageTypeProto enum is untouched and continues to describe DN volume types.

What is the link to the Apache JIRA

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

How was this patch tested?

~30 tests updated for the new bucket surface. Representative changes:

  • OMRequestTestUtils.newBucketInfoBuilder no longer sets storageType on
    the proto (the field is reserved).
  • TestOmBucketInfo, TestBucketManagerImpl, TestOMBucketCreateRequest,
    TestOMBucketCreateRequestWithFSO, TestOMClientRequestWithUserInfo,
    TestOzoneManagerHAWithAllRunning, OzoneRpcClientTests, TestEndpoints
    (recon) migrated from StorageType.X / getStorageType() to
    OzoneStoragePolicy.Y / getStoragePolicy().
  • Recon AbstractTreeNSSummaryScenario and FlatNSSummaryScenario drop
    the storageType assertion (no storage-policy equivalent was set in
    those scenarios).

@devmadhuu
devmadhuu changed the base branch from master to HDDS-11233 September 2, 2026 14:16
@devmadhuu
devmadhuu marked this pull request as ready for review September 3, 2026 11:44
@devmadhuu

Copy link
Copy Markdown
Contributor Author

@xichen01 This patch is adaptation of patch diff 13 from the tar. Thanks for your contribution. Kindly review adaptation patch.

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