From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Rearrange logrep worker's snapshot handling some more. |
Date: | 2021-06-10 16:27:43 |
Message-ID: | E1lrNWx-0005cf-7E@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Rearrange logrep worker's snapshot handling some more.
It turns out that worker.c's code path for TRUNCATE was also
careless about establishing a snapshot while executing user-defined
code, allowing the checks added by commit 84f5c2908 to fail when
a trigger is fired in that context.
We could just wrap Push/PopActiveSnapshot around the truncate call,
but it seems better to establish a policy of holding a snapshot
throughout execution of a replication step. To help with that and
possible future requirements, replace the previous ensure_transaction
calls with pairs of begin/end_replication_step calls.
Per report from Mark Dilger. Back-patch to v11, like the previous
changes.
Discussion: https://postgr.es/m/B4A3AF82-79ED-4F4C-A4E5-CD2622098972@enterprisedb.com
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/eea081ad013d657a2a7857bd591cfcb559c9a94d
Modified Files
--------------
src/backend/replication/logical/worker.c | 70 +++++++++++++++++---------------
1 file changed, 38 insertions(+), 32 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2021-06-10 21:11:46 | pgsql: Reconsider the handling of procedure OUT parameters. |
Previous Message | Tom Lane | 2021-06-10 15:15:22 | pgsql: Shut down EvalPlanQual machinery when LockRows node reaches the |