postgresql/src/backend/commands
Amit Kapila 705e20f855 Optionally disable subscriptions on error.
Logical replication apply workers for a subscription can easily get stuck
in an infinite loop of attempting to apply a change, triggering an error
(such as a constraint violation), exiting with the error written to the
subscription server log, and restarting.

To partially remedy the situation, this patch adds a new subscription
option named 'disable_on_error'. To be consistent with old behavior, this
option defaults to false. When true, both the tablesync worker and apply
worker catch any errors thrown and disable the subscription in order to
break the loop. The error is still also written in the logs.

Once the subscription is disabled, users can either manually resolve the
conflict/error or skip the conflicting transaction by using
pg_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 Dilger
Reviewed-by: Greg Nancarrow, Vignesh C, Amit Kapila, Wang wei, Tang Haiying, Peter Smith, Masahiko Sawada, Shi Yu
Discussion : https://postgr.es/m/DB35438F-9356-4841-89A0-412709EBD3AB%40enterprisedb.com
2022-03-14 09:32:40 +05:30
..
Makefile Move parallel vacuum code to vacuumparallel.c. 2021-12-23 11:42:52 +05:30
aggregatecmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
alter.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
amcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
analyze.c Add VACUUM instrumentation for scanned pages, relfrozenxid. 2022-02-11 16:48:40 -08:00
async.c Reduce more the number of calls to GetMaxBackends() 2022-02-10 10:27:29 +09:00
cluster.c Consolidate VACUUM xid cutoff logic. 2022-02-11 18:26:15 -08:00
collationcmds.c DefineCollation() code cleanup 2022-03-11 08:32:52 +01:00
comment.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
constraint.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
conversioncmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
copy.c Add HEADER support to COPY text format 2022-01-28 09:44:47 +01:00
copyfrom.c Remove redundant memory context switches in BeginCopyFrom(). 2022-01-19 12:31:15 -05:00
copyfromparse.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
copyto.c Parse/analyze function renaming 2022-03-04 14:50:22 +01:00
createas.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dbcommands.c Database-level collation version tracking 2022-02-14 08:27:26 +01:00
define.c Add Boolean node 2022-01-17 10:38:23 +01:00
discard.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dropcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
event_trigger.c Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
explain.c Add compute_query_id = regress 2022-02-22 10:22:15 +09:00
extension.c Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
foreigncmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
functioncmds.c Add Boolean node 2022-01-17 10:38:23 +01:00
indexcmds.c Fix comment in CheckIndexCompatible(). 2022-02-18 12:19:10 +09:00
lockcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
matview.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
opclasscmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
operatorcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
policy.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
portalcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
prepare.c Add pg_analyze_and_rewrite_varparams() 2022-03-07 08:13:30 +01:00
proclang.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
publicationcmds.c Allow specifying row filters for logical replication of tables. 2022-02-22 08:11:50 +05:30
schemacmds.c Parse/analyze function renaming 2022-03-04 14:50:22 +01:00
seclabel.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
sequence.c Logical decoding of sequences 2022-02-10 18:43:51 +01:00
statscmds.c Check syscache result in AlterStatistics 2022-01-23 03:16:31 +01:00
subscriptioncmds.c Optionally disable subscriptions on error. 2022-03-14 09:32:40 +05:30
tablecmds.c Parse/analyze function renaming 2022-03-04 14:50:22 +01:00
tablespace.c Fix DROP {DATABASE,TABLESPACE} on Windows. 2022-02-12 10:21:23 +13:00
trigger.c Add API of sorts for transition table handling in trigger.c 2022-03-11 20:40:03 -03:00
tsearchcmds.c Add Boolean node 2022-01-17 10:38:23 +01:00
typecmds.c Add missing TYPEALIGN macros 2022-02-16 19:33:28 +07:00
user.c Add Boolean node 2022-01-17 10:38:23 +01:00
vacuum.c Avoid VACUUM reltuples distortion. 2022-02-16 17:15:50 -08:00
vacuumparallel.c Unify VACUUM VERBOSE and autovacuum logging. 2022-01-14 16:50:34 -08:00
variable.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
view.c Parse/analyze function renaming 2022-03-04 14:50:22 +01:00