You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Checkthe value of the row andthe replicated time:
99
+
1. Determine whether the value of the row matches onthe source and the destination:
100
100
101
-
{% include_cached copy-clipboard.html %}
102
-
~~~ sql
103
-
SELECT*FROM foo WHERE my_id =207;
104
-
SELECT replicated_time FROM show logical replication jobs;
105
-
~~~
101
+
1. Check the value of the row and the replicated time:
106
102
107
-
1. On the source, check the value of the row as of the replicated time:
103
+
{% include_cached copy-clipboard.html %}
104
+
~~~ sql
105
+
SELECT*FROM foo WHERE my_id =207;
106
+
SELECT replicated_time FROM show logical replication jobs;
107
+
~~~
108
108
109
-
{% include_cached copy-clipboard.html %}
110
-
~~~ sql
111
-
SELECT*FROM foo WHERE my_id =207AS OF SYSTEM TIME {replicated time};
112
-
~~~
109
+
1. On the source, check the value of the row as of the replicated time:
113
110
114
-
1. If the value of the row is the same on both the source and the destination, delete the row from the DLQ on the destination:
111
+
{% include_cached copy-clipboard.html %}
112
+
~~~ sql
113
+
SELECT*FROM foo WHERE my_id =207AS OF SYSTEM TIME {replicated time};
114
+
~~~
115
115
116
-
{% include_cached copy-clipboard.html %}
117
-
~~~ sql
118
-
DELETEFROMcrdb_replication.dlq_271_fooWHERE id =106677386757203;
119
-
~~~
116
+
1. Determine a course of action based on the results of the previous steps:
120
117
121
-
1. If the row's value on the destination is different from its value on the source, but the row's value on the source equals its value inthe DLQ, update the row on the destination to have the same value ason the source:
118
+
1. If the value of the row is the same onboth the source andthe destination, delete the row from the DLQ on the destination:
122
119
123
-
{% include_cached copy-clipboard.html %}
124
-
~~~ sql
125
-
UPSERT into foo VALUES (207, '2025-04-25:35:00.499499', 'blahblahblah=')
126
-
~~~
120
+
{% include_cached copy-clipboard.html %}
121
+
~~~ sql
122
+
DELETEFROMcrdb_replication.dlq_271_fooWHERE id =106677386757203;
123
+
~~~
127
124
128
-
1. If the row's value on the destination is different from its value on the source, and the row's value on the source equals its value in the DLQ, refresh the replicated timeand retry the equality queries above. If the same results hold after a few retries with refreshed replicated times, there is likely a more recent entry for the row in the DLQ. To find the the more recent entry, find all rows in the DLQ with the matching primary key:
125
+
1. If the row's value on the destination is different from its value on the source, but the row's value on the source equals its value in the DLQ, update the row onthe destination to have the same value asonthe source:
UPSERT into foo VALUES (207, '2025-04-25:35:00.499499', 'blahblahblah=')
130
+
~~~
131
+
132
+
1. If the row's value on the destination is different from its value on the source, and the row's value on the source equals its value in the DLQ, refresh the replicated timeand retry the equality queries above. If the same results hold after a few retries with refreshed replicated times, there is likely a more recent entry for the row in the DLQ.
133
+
134
+
1. To find the more recent entry, find all rows in the DLQ with the matching primary key:
Copy file name to clipboardExpand all lines: src/current/v26.1/manage-logical-data-replication.md
+68-7Lines changed: 68 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,7 @@ When a conflict cannot apply due to violating [constraints]({% link {{ page.vers
33
33
34
34
### Dead letter queue (DLQ)
35
35
36
-
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 there is a unique index on the destination table (for more details, refer to [Unique seconday indexes]({% link {{ page.version.version }}/set-up-logical-data-replication.md %}#unique-secondary-indexes)).
37
-
38
-
{{site.data.alerts.callout_info}}
39
-
LDR will not pause when the writes are sent to the DLQ, you must manage the DLQ manually.
40
-
{{site.data.alerts.end}}
41
-
42
-
To manage the DLQ, you can evaluate entries in the `incoming_row` column and apply the row manually to another table with SQL statements.
36
+
When the LDR job starts, it creates a DLQ table with each replicating table so that unresolved conflicts can be tracked. The DLQ contains the writes that LDR cannot apply after the retry period of a minute, which could occur if there is a unique index on the destination table (for more details, refer to [Unique secondary indexes]({% link {{ page.version.version }}/set-up-logical-data-replication.md %}#unique-secondary-indexes)).
43
37
44
38
As an example, for an LDR stream created on the `movr.public.promo_codes` table:
LDR does not pause when writes are sent to the DLQ. You must manage the DLQ manually by examining each entry in the DLQ and either manually reinserting the row or deleting the entry from the DLQ. If you have multiple DLQ entries, resolve them in order from most recent to least recent.
80
+
81
+
To resolve a row in the DLQ:
82
+
83
+
1. On the destination, find the primary key value in the `incoming_row` column.
1. Determine whether the value of the row matches on the source and the destination:
100
+
101
+
1. Check the value of the row and the replicated time:
102
+
103
+
{% include_cached copy-clipboard.html %}
104
+
~~~ sql
105
+
SELECT*FROM foo WHERE my_id =207;
106
+
SELECT replicated_time FROM show logical replication jobs;
107
+
~~~
108
+
109
+
1. On the source, check the value of the row as of the replicated time:
110
+
111
+
{% include_cached copy-clipboard.html %}
112
+
~~~ sql
113
+
SELECT*FROM foo WHERE my_id =207AS OF SYSTEM TIME {replicated time};
114
+
~~~
115
+
116
+
1. Determine a course of action based on the results of the previous steps:
117
+
118
+
1. If the value of the row is the same on both the source and the destination, delete the row from the DLQ on the destination:
119
+
120
+
{% include_cached copy-clipboard.html %}
121
+
~~~ sql
122
+
DELETEFROMcrdb_replication.dlq_271_fooWHERE id =106677386757203;
123
+
~~~
124
+
125
+
1. If the row's value on the destination is different from its value on the source, but the row's value on the source equals its value in the DLQ, update the row on the destination to have the same value ason the source:
126
+
127
+
{% include_cached copy-clipboard.html %}
128
+
~~~ sql
129
+
UPSERT into foo VALUES (207, '2025-04-25:35:00.499499', 'blahblahblah=')
130
+
~~~
131
+
132
+
1. If the row's value on the destination is different from its value on the source, and the row's value on the source equals its value in the DLQ, refresh the replicated timeand retry the equality queries above. If the same results hold after a few retries with refreshed replicated times, there is likely a more recent entry for the row in the DLQ.
133
+
134
+
1. To find the more recent entry, find all rows in the DLQ with the matching primary key:
1. If there are more recent entries for the row, delete the less recent entries and resolve the row using the most recent entry.
143
+
83
144
## Schema changes
84
145
85
146
When you start LDR on a table, the job will lock the schema, which will prevent any accidental [schema changes]({% link {{ page.version.version }}/online-schema-changes.md %}) that would cause issues for LDR. There are some [supported schema changes](#supported-schema-changes) that you can perform on a replicating table, otherwise it is necessary to stop LDR in order to [coordinate the schema change](#coordinate-other-schema-changes).
0 commit comments