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 1n5kbG-0006UH-R5 for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Jan 2022 08:27:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n5kbE-0006Rg-2j for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Jan 2022 08:27:48 +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 1n5kbD-0006Qj-NI for pgsql-hackers@lists.postgresql.org; Fri, 07 Jan 2022 08:27:47 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n5kbB-0003eR-6w for pgsql-hackers@lists.postgresql.org; Fri, 07 Jan 2022 08:27:46 +0000 Received: by mail-pg1-x530.google.com with SMTP id 200so4901969pgg.3 for ; Fri, 07 Jan 2022 00:27:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=eprs2kcnARqxPDgyXONmegmGmcvJ2GgUkb89WepMiYg=; b=c63+prEor+guuDUD70ZrEG7D3x3Wtuj4/QBKipB2CRBpMl5GgP6DnO+vVkmPCdneYx UmYgAPEpsfSSBZRoE5YX5ZbIx1vv/mwdrJzNcuYLdfxhTv3VIOo+p5zCGz2QrSF2VRyT nxIUtBiiUfKxDolH6T8r2y7AzRhAF1Dlm9dyolIPE1q0e4m7ADUp4Ve2wx601h2WWH5C JQ9waNlMBpdI+YXeYkp5GP+uUUIL9vdIwJz12bi9HEgX978O7kitz1LvLfGkXF5QCbSs 0zPVzTDRYlagn3XLLpaoPYYHvSACbAmii0UGxSlLCFAG+pMQywt3EG4axtg1N/uBr4l/ lgcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=eprs2kcnARqxPDgyXONmegmGmcvJ2GgUkb89WepMiYg=; b=jo+gCF/vjyrfMFpSynEeMBQQydgu4HImf4w25MCDOarLenOmRh3yrZo4wE2qz4uHpk 0g+Oucpq1NQbJPLBABg/ncwUAy0WjwL973Svuzs4jHFOpdnuz0dQQN8yWqzgALROP6gT X1cr4nMFJjIdbcoLlrHCczJgxkpVNDsEeKJqHrUzBSlceG1I5dLz3muwvRBylAB2B7Kn q0uWzAIyZv0hFzgs2rJqRMOJvVElcrV5zWasqDRQC6seOhcNP2BUvvDib+F1pZsmmcWc y/m0f+V67Xoe24y+pAsm3ZWZ8xYasIWeG6U3xOrZ5E6aAvskppS07zFzT4DGPBGyPWAY asBA== X-Gm-Message-State: AOAM530Onyqxv9Q0FOHr8QFhAl1nf5vg5f1Yi0uibJgoDuv7krIptg0v TCnegwZEPIMxwfcjIwjXCMo= X-Google-Smtp-Source: ABdhPJzP5ePgMkrmac717AmlZdFxdAp1gOFsM2hk8iDNCbUXgxX3rSNEgODKjEe+6Jf1VvzIcXMysw== X-Received: by 2002:a05:6a00:cc7:b0:4bb:1511:8401 with SMTP id b7-20020a056a000cc700b004bb15118401mr63518591pfv.44.1641544063911; Fri, 07 Jan 2022 00:27:43 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id m14sm4687109pff.151.2022.01.07.00.27.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Jan 2022 00:27:43 -0800 (PST) Date: Fri, 07 Jan 2022 17:27:40 +0900 (JST) Message-Id: <20220107.172740.1571453258855138645.horikyota.ntt@gmail.com> To: satyanarlapuram@gmail.com Cc: pgsql@j-davis.com, bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: Disallow quorum uncommitted (with synchronous standbys) txns in logical replication subscribers From: Kyotaro Horiguchi In-Reply-To: References: <2df227fddc659d1da61a59a54ffa11c03461a84e.camel@j-davis.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Thu, 6 Jan 2022 23:55:01 -0800, SATYANARAYANA NARLAPURAM wrote in > On Thu, Jan 6, 2022 at 11:24 PM Jeff Davis wrote: > > > On Wed, 2022-01-05 at 23:59 -0800, SATYANARAYANA NARLAPURAM wrote: > > > I would like to propose a GUC send_Wal_after_quorum_committed which > > > when set to ON, walsenders corresponds to async standbys and logical > > > replication workers wait until the LSN is quorum committed on the > > > primary before sending it to the standby. This not only simplifies > > > the post failover steps but avoids unnecessary downtime for the async > > > replicas. Thoughts? > > > > Do we need a GUC? Or should we just always require that sync rep is > > satisfied before sending to async replicas? > > > > I proposed a GUC to not introduce a behavior change by default. I have no > strong opinion on having a GUC or making the proposed behavior default, > would love to get others' perspectives as well. > > > > > > It feels like the sync quorum should always be ahead of the async > > replicas. Unless I'm missing a use case, or there is some kind of > > performance gotcha. > > > > I couldn't think of a case that can cause serious performance issues but > will run some experiments on this and post the numbers. I think Jeff is saying that "quorum commit" already by definition means that all out-of-quorum standbys are behind of the quorum-standbys. I agree to that in a dictionary sense. But I can think of the case where the response from the top-runner standby vanishes or gets caught somewhere on network for some reason. In that case the primary happily checks quorum ignoring the top-runner. To avoid that misdecision, I can guess two possible "solutions". One is to serialize WAL sending (of course it is unacceptable at all) or aotehr is to send WAL to all standbys at once then make the decision after making sure receiving replies from all standbys (this is no longer quorum commit in another sense..) So I'm afraid that there's no sensible solution to avoid the hiding-forerunner problem on quorum commit. regards. -- Kyotaro Horiguchi NTT Open Source Software Center