From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Gripes about walsender command processing
Date: Wed, 16 Sep 2020 18:21:08 -0400
Message-ID: <39194.1600294868@sss.pgh.pa.us> (raw)
In-Reply-To: <20200916221422.GA24095@alvherre.pgsql>
References: <20200916221422.GA24095@alvherre.pgsql>
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2020-Sep-16, Tom Lane wrote:
>> I don't see an easy way to improve on it though. The only obvious
>> alternative would be to put another switch before the main one that
>> just fills a "const char *cmdtag" variable, but that seems ugly.
> The alternative of doing the assignment in each case of the same switch
> does not look too terrible:
> case T_IdentifySystemCmd:
> + cmdtag = "IDENTIFY_SYSTEM";
> + set_ps_display(cmdtag);
> IdentifySystem();
> + EndReplicationCommand(cmdtag);
> break;
> case T_BaseBackupCmd:
> + cmdtag = "BASE_BACKUP";
> + set_ps_display(cmdtag);
> PreventInTransactionBlock(true, cmdtag);
> SendBaseBackup((BaseBackupCmd *) cmd_node);
> + EndReplicationCommand(cmdtag);
> break;
Yeah, that works for me. It doesn't allow for having just one
set_ps_display() call ahead of the switch, but that isn't that
big a loss. We cannot merge the EndReplicationCommand calls to
after the switch, because some of the cases don't want one here;
so that partial duplication is inescapable.
Note that your changes need to be backpatched into v13,
because AFAICS this code is violating the FE/BE protocol
right now --- it's just luck that libpq isn't moaning
about extra CommandComplete messages. But I don't think
we want to change the ps title behavior in v13 at this
late date, so that part should be HEAD-only.
regards, tom lane
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, alvherre@2ndquadrant.com, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
Subject: Re: Gripes about walsender command processing
In-Reply-To: <39194.1600294868@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