Skip to content

Commit f321bbf

Browse files
committed
Merge upstream PR redis#3363 into feature/docker-support
DOC-6617 RS: Documented replica_read_only flag (RS 7.22.0-95+) and added warning against writing to Replica Of destination.
2 parents f2ebb82 + c9aa5fe commit f321bbf

4 files changed

Lines changed: 62 additions & 0 deletions

File tree

content/operate/rs/7.22/databases/import-export/replica-of/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ all write commands are synchronized from the sources to the destination.
2222
Replica Of lets you distribute the read load of your application across multiple databases or
2323
synchronize the database, either within Redis Enterprise or external to Redis Enterprise, to another database.
2424

25+
{{< warning >}}
26+
Do not write directly to a Replica Of destination database, because it can result in replication errors, data inconsistencies, or data loss. See [Enforce read-only access]({{<relref "/operate/rs/7.22/databases/import-export/replica-of/create#enforce-read-only-access">}}) for details and instructions.
27+
{{< /warning >}}
28+
2529
You can [create Active-Passive]({{< relref "/operate/rs/7.22/databases/import-export/replica-of/create.md" >}}) databases on Redis Enterprise Software or Redis Cloud.
2630

2731
[Active-Active Geo-Distribution (CRDB)]({{< relref "/operate/rs/7.22/databases/active-active" >}})

content/operate/rs/7.22/databases/import-export/replica-of/create.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,33 @@ To use a database from a Redis Open Source cluster as a Replica Of source:
146146

147147
1. Select **Save**.
148148

149+
### Enforce read-only access
150+
151+
Writing directly to a Replica Of destination database is not supported and can result in replication errors, data inconsistencies, or data loss.
152+
153+
As of Redis Software version 7.22.0-95, you can set `replica_read_only` to `true` when you [create a Replica Of database]({{<relref "operate/rs/7.22/references/rest-api/requests/bdbs#post-bdbs-v2">}}) using the REST API. When enabled, the destination database rejects all write operations to prevent accidental writes. Replication remains one-way from source to destination. You cannot change `replica_read_only` after database creation.
154+
155+
To enforce read-only access when you create a Replica Of destination database:
156+
157+
```sh
158+
POST https://<host>:<port>/v2/bdbs
159+
{
160+
"name": "readonly-replica-db",
161+
"memory_size": 1073741824,
162+
"replica_sources": [
163+
{
164+
"uri": "redis://admin:<password>@<source-host>:<port>"
165+
}
166+
],
167+
"replica_read_only": true,
168+
// Additional fields
169+
}
170+
```
171+
172+
For additional database configuration fields, see the [BDB object]({{<relref "/operate/rs/7.22/references/rest-api/objects/bdb">}}) reference.
173+
174+
For Redis Software versions earlier than 7.22.0-95, there is no product-level enforcement preventing writes to the destination database, so you should configure your application to direct all write operations exclusively to the source database.
175+
149176
## Configure TLS for Replica Of
150177

151178
When you enable TLS for Replica Of, the Replica Of synchronization traffic uses TLS certificates to authenticate the communication between the source and destination clusters.

content/operate/rs/databases/import-export/replica-of/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ all write commands are synchronized from the sources to the destination.
2121
Replica Of lets you distribute the read load of your application across multiple databases or
2222
synchronize the database, either within Redis Software or external to Redis Software, to another database.
2323

24+
{{< warning >}}
25+
Do not write directly to a Replica Of destination database, because it can result in replication errors, data inconsistencies, or data loss. See [Enforce read-only access]({{<relref "/operate/rs/databases/import-export/replica-of/create#enforce-read-only-access">}}) for details and instructions.
26+
{{< /warning >}}
27+
2428
You can [create Active-Passive]({{< relref "/operate/rs/databases/import-export/replica-of/create.md" >}}) databases on Redis Software or Redis Cloud.
2529

2630
[Active-Active Geo-Distribution (CRDB)]({{< relref "/operate/rs/databases/active-active" >}})

content/operate/rs/databases/import-export/replica-of/create.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,33 @@ To use a database from a Redis Open Source cluster as a Replica Of source:
145145

146146
1. Select **Save**.
147147

148+
### Enforce read-only access
149+
150+
Writing directly to a Replica Of destination database is not supported and can result in replication errors, data inconsistencies, or data loss.
151+
152+
As of Redis Software version 7.22.0-95, you can set `replica_read_only` to `true` when you [create a Replica Of database]({{<relref "operate/rs/references/rest-api/requests/bdbs#post-bdbs-v2">}}) using the REST API. When enabled, the destination database rejects all write operations to prevent accidental writes. Replication remains one-way from source to destination. You cannot change `replica_read_only` after database creation.
153+
154+
To enforce read-only access when you create a Replica Of destination database:
155+
156+
```sh
157+
POST https://<host>:<port>/v2/bdbs
158+
{
159+
"name": "readonly-replica-db",
160+
"memory_size": 1073741824,
161+
"replica_sources": [
162+
{
163+
"uri": "redis://admin:<password>@<source-host>:<port>"
164+
}
165+
],
166+
"replica_read_only": true,
167+
// Additional fields
168+
}
169+
```
170+
171+
For additional database configuration fields, see the [BDB object]({{<relref "/operate/rs/references/rest-api/objects/bdb">}}) reference.
172+
173+
For Redis Software versions earlier than 7.22.0-95, there is no product-level enforcement preventing writes to the destination database, so you should configure your application to direct all write operations exclusively to the source database.
174+
148175
## Configure TLS for Replica Of
149176

150177
When you enable TLS for Replica Of, the Replica Of synchronization traffic uses TLS certificates to authenticate the communication between the source and destination clusters.

0 commit comments

Comments
 (0)