Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvW0u-005nso-1D for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 07:42:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvW0t-00Ag6q-0n for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 07:42:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvW0s-00Ag6g-2y for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 07:42:22 +0000 Received: from mail-dl1-x122a.google.com ([2607:f8b0:4864:20::122a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvW0q-00000001Lzk-0LXx for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 07:42:22 +0000 Received: by mail-dl1-x122a.google.com with SMTP id a92af1059eb24-127380532eeso638756c88.1 for ; Wed, 25 Feb 2026 23:42:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772091739; cv=none; d=google.com; s=arc-20240605; b=ixytuFvxaTrAUUUEzPcgI5N3/+q5RlJ+lTq7LjdYQeXu59NUhspORT9IbObcYotJkn 2MJuIDqdLoUewg7jMFuy1YWMz9eEdk2YMJwsijdDiBSRfuGW8O8zSj4gO9/s4AyGkEqi tRERsCvZrfWB04V5KiuqJtnqy8NA9+gc7L/Nf2RI/13kQxHdCYjYk9hxEvTkonvecYTN PChv7Uhm+I8Gb3nyUsLb7ieiVzDSyERHR3mndtWCbclAOqpQyLidEBauL/8g0nAiNKR9 UK66gBW9xTAG3iaxfdlJzd0woNO1zRxE9f3wpRJmuVs1mB3w5OszwdxTIMXM6mA5+T7H vWSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LxXnS7BI5M3cXwwdURr5b81hFds0nVlGAMB1TQDX/g0=; fh=Mk76KDmxBQelq48tljwrE3G864bQTQ5AUBwbXSP3Vl0=; b=atFMC4lZ6RVxSy+6PqMW7tCH/qiLpv7Bs3/2z1m8s7mzLArn5nkKX9ptr2+8PYa3zs FdWlmC57Jgvaj+6kPuiG5qV1NE5OHWM0l06wqy8YtHmq7CkI48tqju+snUXPeWC/v3Bg qHRppfydXCJN1jG2/xmskJrzMe0Igu/TPNL+gg3bXFHqJGkOspEsDcMwBTKLw429+Kzc 0/dTExlwI6O4hmUKVUVFxOKPadUmzdNjUDsDuFR44WFZDfR0lYFzoVHn8VsnHYFaTHA5 BAroZ0iKCwzz7r0j70WwN5pIiEYvSITQGJAscPLaQEMQGsbx8ELMULrJlV7pNT4CaHQR sqRQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772091739; x=1772696539; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LxXnS7BI5M3cXwwdURr5b81hFds0nVlGAMB1TQDX/g0=; b=KA3OyKb3XDcrzIP5qSmr7vJl1r1TjYsRfm/MIC/ZcoJYUiyNyvPA5tTkjxiSvJAiBk wr7d9m2Y5kG+Z1cKs2KOVmjwjFw4JwhBgY5YBgFThdEtp9q7i+EZbYjeoiW6V7qn2+8o 6QY9vi+c2QcSWSGJaLbL5LkGacb0qDAmt/0zHwb9UYdQ97PF+Ogv+HcWclH2DE1wnL1j OmDii/ErZ4nsiU43mDRuqv+ftPwTOQ/cW3Xpmo6kjNa7y0gkllCuR7MOW5KkDxV8enqA 4qr/W1IAcNdQq9ZiEH6MOnEyQs1rigeiJdEfxnGWaubnnQTrqsgiHqrKd+/cQMWcRumT 1Vlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772091739; x=1772696539; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LxXnS7BI5M3cXwwdURr5b81hFds0nVlGAMB1TQDX/g0=; b=Y2sUBnEPrhA+9WMIQmyFucNfxTGeQplvevb3/k6Y9wN/0FgxdfscAIvDXl/wyGoWK8 laSAA1tzB5CHphpWtzL30eTCzKU7cenwBNpMC7QJLgROYYzEs92Jbfe1rOPOe4scrGXy duL7rcZJsMe6+nWQ4jbU/hqaXAFNc/pGOylNx2pqypYRUHE8t4hs+4Lbl8UbiYvC2baT IP1ABqDISIhKKwSblHa7aseOGCYPZWOArKjBrSG9rnvcxUHmLvsY4efc4q1E/bnyYezu r9ghDB9k9ajyx9JEdQzKInEMHQ1pmYyfaR+MvRAr5vxnY3q+IyD2ipRpPYK8oAsNnf4P YKvQ== X-Forwarded-Encrypted: i=1; AJvYcCUqEMl4VM9MdjTzTYESvfAaZWwmRBNDrdpygr+tzErZNG2jJzh/b+48zFVLVD9v14KylrQ0bINE0il4n9Tz@lists.postgresql.org X-Gm-Message-State: AOJu0Ywv6oY4UuOBk7e3+H798aqYqhahZDn9t6Z9qrDj/cPyVB707f8q johPWWvTuoHdQ1WcWC/5NDamJrvIFmm4Y8GDz7FUYjkgNtls4fLjxd8Lt7qraXwW8TZmBQencjc HnE7m2BGkHYzOKSYgt03uXqS41Tecio15+Rh/euM= X-Gm-Gg: ATEYQzzANUIup7Bt/hKNEBxkKr6OjR9CpA28yrQKMj0W/Cc/8h2NVGmMmGnrM3qx4fn IizIBJTwBsNjVQ5ZkhahLt1tykh2nPQm0GRwF9iLS0HMW0O61IbOhIAACgnQgIRcBH870JkVH1y o4b57+l1KTCt1YoHtp9wJpw+CLf/pMmUEiGfawUCcka3bxW+rP/0Rddd1+I4Dkeg/O5xDAEBw42 YlC2l12E3QVj5XX+vP20VZqLLykvQPR0Amtodu3DVYzj5QiBYbHvnnwRScvpelPt4KS8pkVLXiD UA3JI3AFxexI5N4Web+k/pCwbVSqaf9Zy3iEHE9k X-Received: by 2002:a05:7022:50d:b0:11b:9386:7ecc with SMTP id a92af1059eb24-12789ce3dcemr628945c88.41.1772091738683; Wed, 25 Feb 2026 23:42:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ashutosh Sharma Date: Thu, 26 Feb 2026 13:12:06 +0530 X-Gm-Features: AaiRm51GaHVdIy1CFAmbj0wzCQNU3uEapv4qJvuMPu-uw9qe6iSY_HruUasKjVc Message-ID: Subject: Re: synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication To: Amit Kapila Cc: SATYANARAYANA NARLAPURAM , PostgreSQL-development , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Amit, On Thu, Feb 26, 2026 at 11:50=E2=80=AFAM Amit Kapila wrote: > > On Thu, Feb 26, 2026 at 10:28=E2=80=AFAM Ashutosh Sharma wrote: > > > > > > > > > > > > Proposal: > > > > > > > > Make synchronized_standby_slots quorum aware i.e. extend the GUC to= accept an ANY M (slot1, slot2, ...) syntax similar to synchronous_standby_= names, so StandbySlotsHaveCaughtup() can return true when M of N slots (whe= re M <=3D N and M >=3D 1) have caught up. I still prefer two different GUCs= for this as the list of slots to be synchronized can still be different (f= or example, DBA may want to ensure Geo standby to be sync before allowing t= he logical decoding client to read the changes). I kept synchronized_standb= y_slots parse logic similar to synchronous_standby_names to keep things = simple. The default behavior is also not changed for synchronized_standby_= slots. > > > > > ... > > > > Thinking about this further, using quorum settings for > > synchronized_standby_slots can/will certainly result in at least one > > sync standby lagging behind the logical replica, making it probably > > impossible to continue with the existing logical replication setup > > after a failover to the standby that lags behind. Here is what I am > > mean: > > > > But won't that be true even for synchronous_standby_names? I think in > the case of quorum, it is the responsibility of the failover solution > to select the most recent synced standby among all the standby's > specified in synchronous_standby_names. Similarly here before failing > over logical subscriber to one of physical standby, the failover tool > needs to ensure it is switching over to the synced replica. We have > given steps in the docs [1] that could be used to identify the replica > where the subscriber can switchover. Will that address your concern? > Here's my understanding of this: I don't think we should be comparing "synchronous_standby_names" with "synchronized_standby_slots", even though they appear similar in purpose. All values listed in synchronous_standby_names represent synchronous standbys exclusively, whereas synchronized_standby_slots can hold values for both synchronous and asynchronous standbys. In other words, every server referenced by synchronous_standby_names is of the same type, but that may not be the case with synchronized_standby_slots. If a GUC can hold values of different types (sync vs. async), does it really make sense to use a qualifier like ANY 1 (val1, val2) when val1 and val2 are different in nature? For example, suppose val1 is a synchronous standby and val2 is an asynchronous standby, and we configure ANY 1 (val1, val2). It's possible for val2 to get ahead of val1 in terms of replication progress, which in turn could mean the logical replica is also ahead of val1. So if we were to fail over to val1 (since it's the only synchronous standby), we will not be able to use the existing logical replication setup. Please correct me if I have misunderstood anything here. -- With Regards, Ashutosh Sharma.