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 1kIIZr-0001m1-Ia for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2020 21:33:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kIIZq-0002p9-GR for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2020 21:33:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIIZq-0002p2-6P for pgsql-hackers@lists.postgresql.org; Tue, 15 Sep 2020 21:33:26 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kIIZl-00063W-Km for pgsql-hackers@lists.postgresql.org; Tue, 15 Sep 2020 21:33:25 +0000 Received: by mail-qk1-x741.google.com with SMTP id w186so5996049qkd.1 for ; Tue, 15 Sep 2020 14:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=6epAP9Saf4p/KnOTaW8ybdhtritey/4k5HOC00LfXPI=; b=pAc2pWr/fcsOKHNcSw8BqU98adVjPX6hKah+WQh8ZSvX4+MCfSVIi+FCjvQBBxlG7k hMIvyCNJJcBre9kr/iG4UrZa0UaSFLbGZeLD6WeT6mNIjX3Ae85srRwbbnGvwVVIejCZ yFymIiBsU1/zwedSvaxyi1t5sNEIH+QefKu+Fy7s9kRKIud7Irphtt+K82TW3ssG6//J Bqscnzz0jIMGvAsiUIXQ+Ilr5/xe5Gmhnr3TnyDdM8CYATz/FkPtnOyAJPjfZXis97pg uxtYIIDfO/eB2jYCq/Gx1yzLbnERejggnGD0pM5jcO2ZDf2jycSjo4rNdeNSZsv+T1qD d99A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=6epAP9Saf4p/KnOTaW8ybdhtritey/4k5HOC00LfXPI=; b=bBvCQkWA002MbaasbXP0g8+mG860dq09Dw662v3nm4+qDM6WoFRYYhnc2K+fDACtWb SnB3nUHr7F1HisLnMBqj4KcDUBPqR0Z+BbFJyka+T/749GjYeza5GM3MZh88/0MJMh7G oMeDl+aFvDUe0rklT+Pq/oNvoPpZ2+af5ta5gxZcQQ6MMvjNp7tiaPIHlXiTQZL7xeyx x6VIyaCmVowKXMTvKc7mhUOWPn3jAS06SqH9ClBl68JHjkaLGZN5oH+16TURYSXdv/6+ BiwtJ8LnN1RfjsXQ83STMLTvjFsAqKEr0yGDM9DwMeX7zKRzp6CIS5ofXRXte+aOI/Xk RmwA== X-Gm-Message-State: AOAM533NCnMV0GdgxLswMMdo4FubyraHFHD+YsTPfvGqF50suLe/AWpT 6ZyHJXU04DWPW+rCIDHZy7/X1whkcV5SRkazvna2S19TOUdbH+fV921eMBRMtrRj09cLOHzsxxb COZPIvugTMpxmdCPsYXBXhn/CLa6uKUcvxY6H8Tl8y1inmkbW92vMRiL4B0vHR/W0v9xgDNLEsQ Px3g2qqFaEkX/tvnNd X-Google-Smtp-Source: ABdhPJxMh05zwfBy/DaIV98S9OFsLGt6YOS6t/zUuyNWPfq97fpy5wmwRX+52tES5m6uCtJct2B/lQ== X-Received: by 2002:a37:6cf:: with SMTP id 198mr20204805qkg.452.1600205598978; Tue, 15 Sep 2020 14:33:18 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id 18sm17747887qkd.120.2020.09.15.14.33.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 14:33:18 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id A4EA82A153C; Tue, 15 Sep 2020 18:33:16 -0300 (-03) Date: Tue, 15 Sep 2020 18:33:16 -0300 From: Alvaro Herrera To: Tom Lane Cc: Michael Paquier , pgsql-hackers@lists.postgresql.org Subject: Re: Gripes about walsender command processing Message-ID: <20200915213316.GA12416@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1347966.1600195735@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Sep-15, Tom Lane wrote: > [ 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. I overlooked this in 2f9661311b83. From this perspective, I agree it looks wrong. We still have to send *some* completion tag (the 'C' message), but maybe we can invent a separate entry point in dest.c for that -- EndReplicationCommand() or some such -- that takes values from a separate enum? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services