pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Dilger <mark.dilger@enterprisedb.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Simon Riggs <simon.riggs@enterprisedb.com>
Subject: Re: logical replication of truncate command with trigger causes Assert
Date: Wed, 09 Jun 2021 11:23:32 -0400
Message-ID: <1357803.1623252212@sss.pgh.pa.us> (raw)
In-Reply-To: <C6BE98EB-158D-4130-9E1C-C3DCFAE0A023@enterprisedb.com>
References: <B4A3AF82-79ED-4F4C-A4E5-CD2622098972@enterprisedb.com>
	<1250962.1623192946@sss.pgh.pa.us>
	<CBED95D4-5072-4A16-9271-72AB73478817@enterprisedb.com>
	<1254157.1623196736@sss.pgh.pa.us>
	<CAA4eK1+DgDdrcxQkB7s-_PmReJB7HiaFrU2PyCzqGStOwiCVPA@mail.gmail.com>
	<1356183.1623250358@sss.pgh.pa.us>
	<C6BE98EB-158D-4130-9E1C-C3DCFAE0A023@enterprisedb.com>

Mark Dilger <mark.dilger@enterprisedb.com> writes:
>> On Jun 9, 2021, at 7:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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.

Ugh, yeah.  We should never be using Asserts to validate incoming
messages -- a test-and-elog is more appropriate.

			regards, tom lane





view thread (15+ messages)  latest in thread

Message-ID: <1357803.1623252212@sss.pgh.pa.us>
Permalink:  ../1357803.1623252212@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1357803.1623252212@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mark.dilger@enterprisedb.com, amit.kapila16@gmail.com, pgsql-hackers@lists.postgresql.org, peter.eisentraut@enterprisedb.com, simon.riggs@enterprisedb.com
  Subject: Re: logical replication of truncate command with trigger causes Assert
  In-Reply-To: <1357803.1623252212@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox