diff --git a/docs/03-core-concepts/03-namespace/02-buckets/05-default-replication.mdx b/docs/03-core-concepts/03-namespace/02-buckets/05-default-replication.mdx new file mode 100644 index 0000000000..ac8229c7ce --- /dev/null +++ b/docs/03-core-concepts/03-namespace/02-buckets/05-default-replication.mdx @@ -0,0 +1,63 @@ +--- +title: Default Bucket Replication +sidebar_label: Default Replication +--- + +# Default Bucket Replication + +The data redundancy for keys within an Apache Ozone bucket is determined by a replication configuration (type and value). This configuration can be set as an explicit default on the bucket itself, or it can be inherited from cluster-wide defaults if not set on the bucket. This document explains this process. + +## Setting a Default Replication on a Bucket + +When a bucket is created, a default replication configuration can be explicitly stored on the bucket. This bucket-level default will apply to all keys created within it, unless a key is written with its own specific replication override. + +Ozone uses the following order of precedence to set a default replication property **on a bucket** during creation: + +1. **Explicit Flags:** Using both the `--type` and `--replication` flags in the `ozone sh bucket create` command. This is the most direct way to set a bucket's default replication. +2. **Client-Side Value with Type Flag:** Using the `--type` flag during bucket creation in combination with the `ozone.replication` property set in the client's `ozone-site.xml`. + +**Example:** +If `ozone.replication=1` is set on the client, the following command sets the default replication for `bucket2` to `RATIS-1`: +```bash +ozone sh bucket create vol1/bucket2 -t RATIS +``` + +## Fallback to Cluster-Wide Defaults + +If no default replication is set on the bucket during creation (i.e., neither of the methods above is used), the bucket is created **without** an explicit default replication property. + +In this scenario, any key created within that bucket will fall back to using the cluster-wide default replication settings defined in the Ozone Manager's `ozone-site.xml`. + +```xml + + ozone.server.default.replication.type + RATIS + OZONE + + The cluster-wide default replication type (e.g., RATIS, EC) used for keys + when their bucket has no default replication set. + + + + ozone.server.default.replication + 3 + OZONE + + The cluster-wide default replication value used for keys when their + bucket has no default replication set. + + + +``` + +**Example:** +If you run `ozone sh bucket create vol1/bucket1` (with no flags or client properties), the bucket `bucket1` is created with no default replication. When a key is later written to `bucket1` without a specific replication override, it will use the cluster-wide server defaults (e.g., `RATIS-3`). diff --git a/docs/03-core-concepts/03-namespace/02-buckets/05-replication.md b/docs/03-core-concepts/03-namespace/02-buckets/05-replication.md deleted file mode 100644 index d46c3422af..0000000000 --- a/docs/03-core-concepts/03-namespace/02-buckets/05-replication.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -sidebar_label: Default Replication Type ---- - -# Bucket Level Default Replication Type - -**TODO:** File a subtask under [HDDS-9857](https://issues.apache.org/jira/browse/HDDS-9857) and complete this page or section.