Re: logical replication of truncate command with trigger causes Assert
Mark Dilger <mark.dilger@enterprisedb.com>
From: Mark Dilger <mark.dilger@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
Simon Riggs <simon.riggs@enterprisedb.com>
Date: 2021-06-09T15:14:25Z
Lists: pgsql-hackers
> On Jun 9, 2021, at 7:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Here's a draft patch for that. I decided the most sensible way to
> organize this is to pair the existing ensure_transaction() subroutine
> with a cleanup subroutine. Rather unimaginatively, perhaps, I renamed
> it to begin_transaction_step and named the cleanup end_transaction_step.
> (Better ideas welcome.)
Thanks! The regression test I posted earlier passes with this patch applied.
> Somewhat unrelated, but ... am I reading the code correctly that
> apply_handle_stream_start and related routines are using Asserts
> to check that the remote sent stream-control messages in the correct
> order? That seems many degrees short of acceptable.
Even if you weren't reading that correctly, this bit:
xid = pq_getmsgint(s, 4);
Assert(TransactionIdIsValid(xid));
simply asserts that the sending server didn't send an invalid subtransaction id.
—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Commits
-
Don't use Asserts to check for violations of replication protocol.
- fe6a20ce54cb 14.0 landed
- 9eecea7f373a 11.13 landed
- 8b5055812cad 13.4 landed
- 4745c119e01a 10.18 landed
- 1f280e83314f 12.8 landed
-
Rearrange logrep worker's snapshot handling some more.
- eea081ad013d 11.13 landed
- 6e43f1c2df3d 13.4 landed
- 3a09d75b4f6c 14.0 landed
- 26383da7d47a 12.8 landed
-
Restore the portal-level snapshot after procedure COMMIT/ROLLBACK.
- 84f5c2908dad 14.0 cited
-
Logical replication support for TRUNCATE
- 039eb6e92f20 11.0 cited
-
Logical replication support for initial data copy
- 7c4f52409a8c 10.0 cited