pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Gripes about walsender command processing
Date: Tue, 15 Sep 2020 14:48:55 -0400
Message-ID: <1347966.1600195735@sss.pgh.pa.us> (raw)
In-Reply-To: <20200915050655.GN2183@paquier.xyz>
References: <880181.1600026471@sss.pgh.pa.us>
	<20200914080454.GE2183@paquier.xyz>
	<1122166.1600102299@sss.pgh.pa.us>
	<20200915032215.GM2183@paquier.xyz>
	<1236185.1600140884@sss.pgh.pa.us>
	<20200915050655.GN2183@paquier.xyz>

Michael Paquier <michael@paquier.xyz> writes:
> On Mon, Sep 14, 2020 at 11:34:44PM -0400, Tom Lane wrote:
>> (I don't quite follow your comment about repslot drop, btw.)

> There is already a command tag equivalent to DROP_REPLICATION_SLOT:
> $ git grep REPLICATION -- */cmdtaglist.h
> src/include/tcop/cmdtaglist.h:PG_CMDTAG(CMDTAG_DROP_REPLICATION_SLOT,
> "DROP REPLICATION SLOT", false, false, false)

[ blink ... ]  So why is it that DropReplicationSlot does

	SetQueryCompletion(&qc, CMDTAG_DROP_REPLICATION_SLOT, 0);
	EndCommand(&qc, DestRemote, false);

when the caller will immediately after that do

	SetQueryCompletion(&qc, CMDTAG_SELECT, 0);
	EndCommand(&qc, DestRemote, true);

StartLogicalReplication has a similar weirdness.
The more I look at this code, the more broken it seems.

Anyway, independently of whether walsender should be sending multiple
command-complete messages, I don't think I really approve of including
replication commands in the CommandTag enum.  It still seems like a
type pun.  However, it looks like we'd have to duplicate
SetQueryCompletion/EndCommand if we don't want to do that, so maybe
I'd better just hold my nose and do it that way.

			regards, tom lane





view thread (16+ messages)  latest in thread

Message-ID: <1347966.1600195735@sss.pgh.pa.us>
Permalink:  ../1347966.1600195735@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1347966.1600195735@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, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
  Subject: Re: Gripes about walsender command processing
  In-Reply-To: <1347966.1600195735@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