forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit705e20f

Amit Kapila
Optionally disable subscriptions on error.
Logical replication apply workers for a subscription can easily get stuckin an infinite loop of attempting to apply a change, triggering an error(such as a constraint violation), exiting with the error written to thesubscription server log, and restarting.To partially remedy the situation, this patch adds a new subscriptionoption named 'disable_on_error'. To be consistent with old behavior, thisoption defaults to false. When true, both the tablesync worker and applyworker catch any errors thrown and disable the subscription in order tobreak the loop. The error is still also written in the logs.Once the subscription is disabled, users can either manually resolve theconflict/error or skip the conflicting transaction by usingpg_replication_origin_advance() function. After resolving the conflict,users need to enable the subscription to allow apply process to proceed.Author: Osumi Takamichi and Mark DilgerReviewed-by: Greg Nancarrow, Vignesh C, Amit Kapila, Wang wei, Tang Haiying, Peter Smith, Masahiko Sawada, Shi YuDiscussion :https://postgr.es/m/DB35438F-9356-4841-89A0-412709EBD3AB%40enterprisedb.com1 parent369398e commit705e20f
File tree
17 files changed
+421
-108
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- replication/logical
- bin
- pg_dump
- psql
- include/catalog
- test
- regress
- expected
- sql
- subscription/t
17 files changed
+421
-108
lines changedLines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7769 | 7769 |
| |
7770 | 7770 |
| |
7771 | 7771 |
| |
| 7772 | + | |
| 7773 | + | |
| 7774 | + | |
| 7775 | + | |
| 7776 | + | |
| 7777 | + | |
| 7778 | + | |
| 7779 | + | |
| 7780 | + | |
| 7781 | + | |
7772 | 7782 |
| |
7773 | 7783 |
| |
7774 | 7784 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
364 | 364 |
| |
365 | 365 |
| |
366 | 366 |
| |
367 |
| - | |
368 |
| - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
369 | 370 |
| |
370 | 371 |
| |
371 | 372 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
204 | 204 |
| |
205 | 205 |
| |
206 | 206 |
| |
207 |
| - | |
208 |
| - | |
| 207 | + | |
| 208 | + | |
209 | 209 |
| |
210 | 210 |
| |
211 | 211 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
290 | 290 |
| |
291 | 291 |
| |
292 | 292 |
| |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
293 | 305 |
| |
294 | 306 |
| |
295 | 307 |
| |
|
Lines changed: 40 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| 72 | + | |
72 | 73 |
| |
73 | 74 |
| |
74 | 75 |
| |
| |||
156 | 157 |
| |
157 | 158 |
| |
158 | 159 |
| |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
159 | 199 |
| |
160 | 200 |
| |
161 | 201 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1261 | 1261 |
| |
1262 | 1262 |
| |
1263 | 1263 |
| |
1264 |
| - | |
| 1264 | + | |
| 1265 | + | |
1265 | 1266 |
| |
1266 | 1267 |
| |
1267 | 1268 |
| |
|
Lines changed: 25 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| 64 | + | |
64 | 65 |
| |
65 | 66 |
| |
66 | 67 |
| |
| |||
82 | 83 |
| |
83 | 84 |
| |
84 | 85 |
| |
| 86 | + | |
85 | 87 |
| |
86 | 88 |
| |
87 | 89 |
| |
| |||
130 | 132 |
| |
131 | 133 |
| |
132 | 134 |
| |
| 135 | + | |
| 136 | + | |
133 | 137 |
| |
134 | 138 |
| |
135 | 139 |
| |
| |||
249 | 253 |
| |
250 | 254 |
| |
251 | 255 |
| |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
252 | 265 |
| |
253 | 266 |
| |
254 | 267 |
| |
| |||
390 | 403 |
| |
391 | 404 |
| |
392 | 405 |
| |
393 |
| - | |
| 406 | + | |
| 407 | + | |
394 | 408 |
| |
395 | 409 |
| |
396 | 410 |
| |
| |||
464 | 478 |
| |
465 | 479 |
| |
466 | 480 |
| |
| 481 | + | |
467 | 482 |
| |
468 | 483 |
| |
469 | 484 |
| |
| |||
864 | 879 |
| |
865 | 880 |
| |
866 | 881 |
| |
867 |
| - | |
| 882 | + | |
868 | 883 |
| |
869 | 884 |
| |
870 | 885 |
| |
| |||
913 | 928 |
| |
914 | 929 |
| |
915 | 930 |
| |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
916 | 939 |
| |
917 | 940 |
| |
918 | 941 |
| |
|
0 commit comments
Comments
(0)