Skip to content

Commit be1c0f1

Browse files
committed
Update LDR docs for GA & remove validated
1 parent 98dc94b commit be1c0f1

16 files changed

+54
-116
lines changed

src/current/v24.3/create-logical-replication-stream.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ Option | Description
5050
`cursor` | Emits any changes after the specified timestamp. LDR will not perform an initial backfill with the `cursor` option, it will stream any changes after the specified timestamp. The LDR job will encounter an error if you specify a `cursor` timestamp that is before the configured [garbage collection]({% link {{ page.version.version }}/architecture/storage-layer.md %}#garbage-collection) window for that table. **Warning:** Apply the `cursor` option carefully to LDR streams. Using a timestamp in error could cause data loss.
5151
<a id="discard-ttl-deletes-option"></a>`discard` | ([**Unidirectional LDR only**]({% link {{ page.version.version }}/logical-data-replication-overview.md %}#use-cases)) Ignore [TTL deletes]({% link {{ page.version.version }}/row-level-ttl.md %}) in an LDR stream with `discard = ttl-deletes`. **Note**: To ignore row-level TTL deletes in an LDR stream, it is necessary to set the [`ttl_disable_changefeed_replication`]({% link {{ page.version.version }}/row-level-ttl.md %}#ttl-storage-parameters) storage parameter on the source table. Refer to the [Ignore row-level TTL deletes](#ignore-row-level-ttl-deletes) example.
5252
`label` | Tracks LDR metrics at the job level. Add a user-specified string with `label`. Refer to [Metrics labels]({% link {{ page.version.version }}/logical-data-replication-monitoring.md %}#metrics-labels).
53-
`mode` | Determines how LDR replicates the data to the destination cluster. Possible values: `immediate`, `validated`. For more details, refer to [LDR modes](#ldr-modes).
54-
55-
## LDR modes
56-
57-
_Modes_ determine how LDR replicates the data to the destination cluster. There are two modes:
58-
59-
- `immediate` (default): {% include {{ page.version.version }}/ldr/immediate-description.md %}
60-
- `validated`: {% include {{ page.version.version }}/ldr/validated-description.md %}
6153

6254
## Bidirectional LDR
6355

src/current/v24.3/logical-data-replication-overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Isolate critical application workloads from non-critical application workloads.
4444
- **Table-level replication**: When you initiate LDR, it will replicate all of the source table's existing data to the destination table. From then on, LDR will replicate the source table's data to the destination table to achieve eventual consistency.
4545
- **Last write wins conflict resolution**: LDR uses [_last write wins (LWW)_ conflict resolution]({% link {{ page.version.version }}/manage-logical-data-replication.md %}#conflict-resolution), which will use the latest [MVCC]({% link {{ page.version.version }}/architecture/storage-layer.md %}#mvcc) timestamp to resolve a conflict in row insertion.
4646
- **Dead letter queue (DLQ)**: When LDR starts, the job will create a [DLQ table]({% link {{ page.version.version }}/manage-logical-data-replication.md %}#dead-letter-queue-dlq) with each replicating table in order to track unresolved conflicts. You can interact and manage this table like any other SQL table.
47-
- **Replication modes**: LDR offers different [_modes_]({% link {{ page.version.version }}/create-logical-replication-stream.md %}#ldr-modes) that apply data differently during replication, which allows you to consider optimizing for throughput or constraints during replication.
4847
- **Monitoring**: To [monitor]({% link {{ page.version.version }}/logical-data-replication-monitoring.md %}) LDR's initial progress, current status, and performance, you can view metrics available in the DB Console, Prometheus, and Metrics Export.
4948

5049
## Get started

src/current/v24.3/manage-logical-data-replication.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In LDR, conflicts are detected at both the [KV]({% link {{ page.version.version
2222

2323
### KV level conflicts
2424

25-
LDR uses _last write wins (LWW)_ conflict resolution based on the [MVCC timestamp]({% link {{ page.version.version }}/architecture/storage-layer.md %}#mvcc) of the replicating write. LDR will resolve conflicts by inserting the row with the latest MVCC timestamp. Conflicts at the KV level are detected in both `immediate` and `validated` mode.
25+
LDR uses _last write wins (LWW)_ conflict resolution based on the [MVCC timestamp]({% link {{ page.version.version }}/architecture/storage-layer.md %}#mvcc) of the replicating write. LDR will resolve conflicts by inserting the row with the latest MVCC timestamp.
2626

2727
Conflicts at the KV level are detected when there is either:
2828

@@ -31,21 +31,16 @@ Conflicts at the KV level are detected when there is either:
3131

3232
### SQL level conflicts
3333

34-
In `validated` mode, when a conflict cannot apply due to violating [constraints]({% link {{ page.version.version }}/constraints.md %}), for example, a foreign key constraint or schema constraint, it will be retried for up to a minute and then put in the [DLQ](#dead-letter-queue-dlq) if it could not be resolved.
34+
When a conflict cannot apply due to violating [constraints]({% link {{ page.version.version }}/constraints.md %}), for example, a foreign key constraint or schema constraint, LDR will send the row to the [DLQ](#dead-letter-queue-dlq).
3535

3636
### Dead letter queue (DLQ)
3737

38-
When the LDR job starts, it will create a DLQ table with each replicating table so that unresolved conflicts can be tracked. The DLQ will contain the writes that LDR cannot apply after the retry period, which could occur if:
38+
When the LDR job starts, it will create a DLQ table with each replicating table so that unresolved conflicts can be tracked. The DLQ will contain the writes that LDR cannot apply after the retry period of a minute, which could occur if:
3939

4040
- The destination table was dropped.
4141
- The destination cluster is unavailable.
4242
- Tables schemas do not match.
4343

44-
In `validated` mode, rows are also sent to the DLQ when:
45-
46-
- [Foreign key]({% link {{ page.version.version }}/foreign-key.md %}) dependencies are not met where there are foreign key constraints in the schema.
47-
- Unique indexes and other constraints are not met.
48-
4944
{{site.data.alerts.callout_info}}
5045
LDR will not pause when the writes are sent to the DLQ, you must manage the DLQ manually.
5146
{{site.data.alerts.end}}

src/current/v24.3/set-up-logical-data-replication.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If you're setting up bidirectional LDR, both clusters will act as a source and a
2222

2323
1. Prepare the tables on each cluster with the prerequisites for starting LDR.
2424
1. Set up an [external connection]({% link {{ page.version.version }}/create-external-connection.md %}) on cluster B (which will be the destination cluster initially) to hold the connection URI for cluster A.
25-
1. Start LDR from cluster B with your required modes.
25+
1. Start LDR from cluster B with your required options.
2626
1. (Optional) Run Steps 1 to 3 again with cluster B as the source and A as the destination, which starts LDR streaming from cluster B to A.
2727
1. Check the status of the LDR job in the [DB Console]({% link {{ page.version.version }}/ui-overview.md %}).
2828

@@ -36,10 +36,6 @@ You'll need:
3636
- All nodes in each cluster will need access to the Certificate Authority for the other cluster. Refer to [Step 2. Connect from the destination to the source](#step-2-connect-from-the-destination-to-the-source).
3737
- LDR replicates at the table level, which means clusters can contain other tables that are not part of the LDR job. If both clusters are empty, create the tables that you need to replicate with **identical** schema definitions (excluding indexes) on both clusters. If one cluster already has an existing table that you'll replicate, ensure the other cluster's table definition matches. For more details on the supported schemas, refer to [Schema Validation](#schema-validation).
3838

39-
{% comment %}To add later, after further dev work{{site.data.alerts.callout_info}}
40-
If you need to run LDR through a load balancer, use the load balancer IP address as the SQL advertise address on each cluster. It is important to note that using a load balancer with LDR can impair performance.
41-
{{site.data.alerts.end}}{% endcomment %}
42-
4339
To create bidirectional LDR, you can complete the [optional step](#step-4-optional-set-up-bidirectional-ldr) to start the second LDR job that sends writes from the table on cluster B to the table on cluster A.
4440

4541
### Schema validation
@@ -55,7 +51,20 @@ You cannot use LDR on a table with a schema that contains the following:
5551

5652
For more details, refer to the LDR [Known limitations]({% link {{ page.version.version }}/logical-data-replication-overview.md %}#known-limitations).
5753

58-
When you run LDR in [`immediate` mode](#modes), you cannot replicate a table with [foreign key constraints]({% link {{ page.version.version }}/foreign-key.md %}). In [`validated` mode](#modes), foreign key constraints **must** match. All constraints are enforced at the time of SQL/application write.
54+
LDR does not support replicating a table with [foreign key constraints]({% link {{ page.version.version }}/foreign-key.md %}).
55+
56+
#### Unique secondary indexes
57+
58+
In LDR, the presence of unique [secondary index]({% link {{ page.version.version }}/schema-design-indexes.md %}) constraints on the destination table can increase the likelihood of rows being sent to the [_dead letter queue_ (DLQ)]({% link {{ page.version.version }}/manage-logical-data-replication.md %}). The two clusters in LDR operate independently, so writes to one cluster can conflict with writes to the other.
59+
60+
If the application modifies the same row in both clusters, LDR resolves the conflict using _last write wins_ (LWW) conflict resolution. [`UNIQUE` constraints]({% link {{ page.version.version }}/unique.md %}) are validated locally in each cluster, therefore if a replicated write violates a `UNIQUE` constraint on the destination cluster—possibly because a conflicting write was already applied to the row—the replicating row will be applied to the DLQ.
61+
62+
For example, consider a table with a unique `email` column. If an application attempts to insert (`gen_random_uuid()`, `[email protected]`) into both clusters simultaneously, the insert will succeed in both clusters, but the records will have different [primary keys]({% link {{ page.version.version }}/primary-key.md %}). When the rows are replicated, LDR will DLQ the row in the peer cluster.
63+
64+
To reduce DLQ entries and allow LDR to be eventually consistent, we recommend:
65+
66+
- For **unidirectional** LDR, validate unique index constraints on the source cluster only.
67+
- For **bidirectional** LDR, remove unique index constraints on both clusters.
5968

6069
## Step 1. Prepare the cluster
6170

@@ -117,20 +126,13 @@ You can use the `cockroach encode-uri` command to generate a connection string c
117126
118127
In this step, you'll start the LDR job from the destination cluster. You can replicate one or multiple tables in a single LDR job. You cannot replicate system tables in LDR, which means that you must manually apply configurations and cluster settings, such as [row-level TTL]({% link {{ page.version.version }}/row-level-ttl.md %}) and user permissions on the destination cluster.
119128

120-
<a id="modes"></a>_Modes_ determine how LDR replicates the data to the destination cluster. There are two modes:
121-
122-
- `immediate` (default): {% include {{ page.version.version }}/ldr/immediate-description.md %}
123-
- `validated`: {% include {{ page.version.version }}/ldr/validated-description.md %}
124-
125129
1. From the **destination** cluster, start LDR. Use the fully qualified table name for the source and destination tables:
126130

127131
{% include_cached copy-clipboard.html %}
128132
~~~ sql
129133
CREATE LOGICAL REPLICATION STREAM FROM TABLE {database.public.source_table_name} ON 'external://{source_external_connection}' INTO TABLE {database.public.destination_table_name};
130134
~~~
131135

132-
You can change the default `mode` using the `WITH mode = validated` syntax.
133-
134136
If you would like to add multiple tables to the LDR job, ensure that the table name in the source table list and destination table list are in the same order:
135137

136138
{% include_cached copy-clipboard.html %}

src/current/v25.1/create-logical-replication-stream.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ Option | Description
5454
`cursor` | Emits any changes after the specified timestamp. LDR will not perform an initial backfill with the `cursor` option, it will stream any changes after the specified timestamp. The LDR job will encounter an error if you specify a `cursor` timestamp that is before the configured [garbage collection]({% link {{ page.version.version }}/architecture/storage-layer.md %}#garbage-collection) window for that table. **Warning:** Apply the `cursor` option carefully to LDR streams. Using a timestamp in error could cause data loss.
5555
<a id="discard-ttl-deletes-option"></a>`discard` | ([**Unidirectional LDR only**]({% link {{ page.version.version }}/logical-data-replication-overview.md %}#use-cases)) Ignore [TTL deletes]({% link {{ page.version.version }}/row-level-ttl.md %}) in an LDR stream with `discard = ttl-deletes`. **Note**: To ignore row-level TTL deletes in an LDR stream, it is necessary to set the [`ttl_disable_changefeed_replication`]({% link {{ page.version.version }}/row-level-ttl.md %}#ttl-storage-parameters) storage parameter on the source table. Refer to the [Ignore row-level TTL deletes](#ignore-row-level-ttl-deletes) example.
5656
`label` | Tracks LDR metrics at the job level. Add a user-specified string with `label`. Refer to [Metrics labels]({% link {{ page.version.version }}/logical-data-replication-monitoring.md %}#metrics-labels).
57-
`mode` | Determines how LDR replicates the data to the destination cluster. Possible values: `immediate`, `validated`. For more details, refer to [LDR modes](#ldr-modes).
58-
59-
## LDR modes
60-
61-
_Modes_ determine how LDR replicates the data to the destination cluster. There are two modes:
62-
63-
- `immediate` (default): {% include {{ page.version.version }}/ldr/immediate-description.md %}
64-
- `validated`: {% include {{ page.version.version }}/ldr/validated-description.md %}
6557

6658
## Bidirectional LDR
6759

src/current/v25.1/create-logically-replicated.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ Option | Description
5555
-------+------------
5656
`bidirectional on` / `unidirectional` | (**Required**) Specifies whether the LDR stream will be unidirectional or bidirectional. With `bidirectional on` specified, LDR will set up two LDR streams between the clusters. Refer to the examples for [unidirectional](#unidirectional) and [bidirectional](#bidirectional).
5757
`label` | Tracks LDR metrics at the job level. Add a user-specified string with `label`. For more details, refer to [Metrics labels]({% link {{ page.version.version }}/logical-data-replication-monitoring.md %}#metrics-labels).
58-
`mode` | Determines how LDR replicates the data to the destination cluster. Possible values: `immediate`, `validated`. For more details, refer to [LDR modes](#ldr-modes).
59-
60-
## LDR modes
61-
62-
_Modes_ determine how LDR replicates the data to the destination cluster. There are two modes:
63-
64-
- `immediate` (default): {% include {{ page.version.version }}/ldr/immediate-description.md %}
65-
- `validated`: {% include {{ page.version.version }}/ldr/validated-description.md %}
6658

6759
## Examples
6860

@@ -74,7 +66,7 @@ From the destination cluster of the LDR stream, run:
7466

7567
{% include_cached copy-clipboard.html %}
7668
~~~ sql
77-
CREATE LOGICALLY REPLICATED TABLE {database.public.destination_table_name} FROM TABLE {database.public.source_table_name} ON 'external://source' WITH unidirectional, mode=validated;
69+
CREATE LOGICALLY REPLICATED TABLE {database.public.destination_table_name} FROM TABLE {database.public.source_table_name} ON 'external://source' WITH unidirectional;
7870
~~~
7971

8072
Include the following:

src/current/v25.1/logical-data-replication-overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Isolate critical application workloads from non-critical application workloads.
4444
- **Table-level replication**: When you initiate LDR, it will replicate all of the source table's existing data to the destination table. From then on, LDR will replicate the source table's data to the destination table to achieve eventual consistency.
4545
- **Last write wins conflict resolution**: LDR uses [_last write wins (LWW)_ conflict resolution]({% link {{ page.version.version }}/manage-logical-data-replication.md %}#conflict-resolution), which will use the latest [MVCC]({% link {{ page.version.version }}/architecture/storage-layer.md %}#mvcc) timestamp to resolve a conflict in row insertion.
4646
- **Dead letter queue (DLQ)**: When LDR starts, the job will create a [DLQ table]({% link {{ page.version.version }}/manage-logical-data-replication.md %}#dead-letter-queue-dlq) with each replicating table in order to track unresolved conflicts. You can interact and manage this table like any other SQL table.
47-
- **Replication modes**: LDR offers different [_modes_]({% link {{ page.version.version }}/create-logical-replication-stream.md %}#ldr-modes) that apply data differently during replication, which allows you to consider optimizing for throughput or constraints during replication.
4847
- **Monitoring**: To [monitor]({% link {{ page.version.version }}/logical-data-replication-monitoring.md %}) LDR's initial progress, current status, and performance, you can view metrics available in the DB Console, Prometheus, and Metrics Export.
4948

5049
## Get started

src/current/v25.1/manage-logical-data-replication.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In LDR, conflicts are detected at both the [KV]({% link {{ page.version.version
2222

2323
### KV level conflicts
2424

25-
LDR uses _last write wins (LWW)_ conflict resolution based on the [MVCC timestamp]({% link {{ page.version.version }}/architecture/storage-layer.md %}#mvcc) of the replicating write. LDR will resolve conflicts by inserting the row with the latest MVCC timestamp. Conflicts at the KV level are detected in both `immediate` and `validated` mode.
25+
LDR uses _last write wins (LWW)_ conflict resolution based on the [MVCC timestamp]({% link {{ page.version.version }}/architecture/storage-layer.md %}#mvcc) of the replicating write. LDR will resolve conflicts by inserting the row with the latest MVCC timestamp.
2626

2727
Conflicts at the KV level are detected when there is either:
2828

@@ -31,21 +31,16 @@ Conflicts at the KV level are detected when there is either:
3131

3232
### SQL level conflicts
3333

34-
In `validated` mode, when a conflict cannot apply due to violating [constraints]({% link {{ page.version.version }}/constraints.md %}), for example, a foreign key constraint or schema constraint, it will be retried for up to a minute and then put in the [DLQ](#dead-letter-queue-dlq) if it could not be resolved.
34+
When a conflict cannot apply due to violating [constraints]({% link {{ page.version.version }}/constraints.md %}), for example, a foreign key constraint or schema constraint, LDR will send the row to the [DLQ](#dead-letter-queue-dlq).
3535

3636
### Dead letter queue (DLQ)
3737

38-
When the LDR job starts, it will create a DLQ table with each replicating table so that unresolved conflicts can be tracked. The DLQ will contain the writes that LDR cannot apply after the retry period, which could occur if:
38+
When the LDR job starts, it will create a DLQ table with each replicating table so that unresolved conflicts can be tracked. The DLQ will contain the writes that LDR cannot apply after the retry period of a minute, which could occur if:
3939

4040
- The destination table was dropped.
4141
- The destination cluster is unavailable.
4242
- Tables schemas do not match.
4343

44-
In `validated` mode, rows are also sent to the DLQ when:
45-
46-
- [Foreign key]({% link {{ page.version.version }}/foreign-key.md %}) dependencies are not met where there are foreign key constraints in the schema.
47-
- Unique indexes and other constraints are not met.
48-
4944
{{site.data.alerts.callout_info}}
5045
LDR will not pause when the writes are sent to the DLQ, you must manage the DLQ manually.
5146
{{site.data.alerts.end}}

0 commit comments

Comments
 (0)