Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIG0j-0003lI-4j for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2020 18:49:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kIG0h-0006zX-Uw for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2020 18:48:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIG0h-0006zQ-OL for pgsql-hackers@lists.postgresql.org; Tue, 15 Sep 2020 18:48:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIG0f-0004Sl-IP for pgsql-hackers@lists.postgresql.org; Tue, 15 Sep 2020 18:48:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08FImtrx1347967; Tue, 15 Sep 2020 14:48:55 -0400 From: Tom Lane To: Michael Paquier cc: pgsql-hackers@lists.postgresql.org Subject: Re: Gripes about walsender command processing 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> Comments: In-reply-to Michael Paquier message dated "Tue, 15 Sep 2020 14:06:55 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1347965.1600195735.1@sss.pgh.pa.us> Date: Tue, 15 Sep 2020 14:48:55 -0400 Message-ID: <1347966.1600195735@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier 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