mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Only kill sync workers at commit time in subscription DDL
This allows a transaction abort to avoid killing those workers. Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
This commit is contained in:
@ -2277,6 +2277,15 @@ PrepareTransaction(void)
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("cannot PREPARE a transaction that has exported snapshots")));
|
||||
|
||||
/*
|
||||
* Don't allow PREPARE but for transaction that has/might kill logical
|
||||
* replication workers.
|
||||
*/
|
||||
if (XactManipulatesLogicalReplicationWorkers())
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("cannot PREPARE a transaction that has manipulated logical replication workers")));
|
||||
|
||||
/* Prevent cancel/die interrupt while cleaning up */
|
||||
HOLD_INTERRUPTS();
|
||||
|
||||
|
Reference in New Issue
Block a user