Re: Gripes about walsender command processing

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Gripes about walsender command processing
Дата
Msg-id 1347966.1600195735@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Gripes about walsender command processing  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [HACKERS] [PATCH] Generic type subscripting
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Simplified version of read_binary_file (src/backend/utils/adt/genfile.c)