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 1vvWzy-006Ydr-3A for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 08:45:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvWzw-00BJ1N-2H for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 08:45:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvWzw-00BJ19-0w for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 08:45:28 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvWzt-00000001GVE-1fps for pgsql-hackers@postgresql.org; Thu, 26 Feb 2026 08:45:27 +0000 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-3562e98d533so304029a91.0 for ; Thu, 26 Feb 2026 00:45:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772095526; cv=none; d=google.com; s=arc-20240605; b=DTMp9eaMG3YA3c+vlVJH1dFuGg6jpC0jkA+Eksi7xWxmnVAfo3jz/TT5h83enB2/Ph pJwvY2550exSAnKUUa/Es3LwtL0M7aG5EfL2IebN1CVloVsI/qLUX0GAnDcu0xdEumeQ Eme4NROnXCUgAjdwSf6rhLJkH36Ot5y6Q/2bdfB/yFp3j5KFb25BJ6cJpIo09EKr8Lgf FALFf0cnT5xgNNZT57M7A1gm+XKcjrcfxXijBbEoF+K6aILJw8Xa6KPUo3wwTKWCVcdh x/mP+GWzohdf6Yl/4swL2P9LSivqC8Hp4MPIFGvFdIuua1XyecXBw0L6CozbRz4W3qwL IvsA== 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=3RxUqPSRCfBocqNqv1O8uAKdfOZghectE4oIXsFzWAA=; fh=cSnbGwKHHuyIfIpSMmdr1aDcU17cJYBdVYm5VWmWreI=; b=iXVIZaSriweCzlAb5lQZ3pazt8ybS6LFIIht0/dU4PK3KZU6guqSNaEsat73D/9LxT EbRcmqUq5nEg0opJ8nZO35VJTGXXoRE4X2gYvEWNBucxeWSpT0d0ZXomje9fkDpgGD62 lTpMCxgMmCCYEHvuGvcx+rqEHfNAvTtPk+Yuu2moWPKj8LGJ1lBg4lY4OAsX1VknkY2P /l3dBWiuRobtYD98IhIHfmMhByY+DayxpAchfF500/UA/NCL3toCxQg4vsQqHww4MEdW BBNNN+qZ2mz4mpfXOR5T3qJvNvPhJpdWwC4oBarJKrDddj6bOXrBdbMZQIyGzSWGIscN aa3w==; darn=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=1772095526; x=1772700326; darn=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=3RxUqPSRCfBocqNqv1O8uAKdfOZghectE4oIXsFzWAA=; b=SyqxJNSIgV1G5FKdC1K5pVnYyXDBkud9O9AMqSp0kTuvbjc7d4B2lB9cAjT5pBFpnD Ro55uFKQQh3Cnqcx9Ru04QSNNp9y2OXp5RQevMW9T3BfS6j6Oiz5Uzfd5bTX1cwWz4uz j9PqSIjbjjvviMbSHQolfYx7AwWV0US1RS5Es3gEjlM23WKFJJIfkM8f2eRZp4CWu7AW qr8WYKvCwQqXrSFnAiFmDKhcvEFIyPoal12xsGbmKXXimoBZn2AEd9yGseNvCfTaxA3O qykSVNdAJ7LPFClrPdd0zeRLDFDZuIexZwVDm+wBRjUXGj165n+6wx2kfm98IEmFivIa MLpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772095526; x=1772700326; 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=3RxUqPSRCfBocqNqv1O8uAKdfOZghectE4oIXsFzWAA=; b=llqXnz5+lMMDYlAEdfUya3U1RAwV37xinw3vMdyVweXSRgnPYezHRBJ28wX8FiPWoT J5gqc3JKE5k0KQXRP4Ek5ysoHYabI/lXA7Ok8EaaWGtw7FWXMYWOK5e1FheUebB4rk0F Q9tz2G44BtDPGiNJv5Qi6DR4xlcKs+MtUwt/mSSoVzLHKk7Swgpgx61i76+SYP+FUz+/ CBpGN5J12ENQ3omA9j0uB4kE8v+OsjyPyWTW4l6N67ik2H0DAJlee676okfwngQSHjTO y9exvPMG9pNATdlGU/TL/yGB4w6kx6p1wS6hkX14Ox3V8otdvOAxv43uVPirXTaxon7L x2HA== X-Forwarded-Encrypted: i=1; AJvYcCVXVcH+mlvQMRHx0bPFSI/YGoTl8ISJgBcM435RXdel/bTF5U/FQB0mXm54rBSiDQUiL18Raa40OZNfFguW@postgresql.org X-Gm-Message-State: AOJu0YwaqpqnDaXFgB8jtxuKILL8Wwk8KleIksfTuuRDpcF+wcTFKST9 +koJ7g7GQ4CJGUyrVs86yB5WmHBbQmdzQN/GGznlrrhOwWPcdzr0RcSAq8H/UIzyl7HstkjxvJJ PTbwktRWcyQu0/tlvvezgf2+eSVz8eIs= X-Gm-Gg: ATEYQzwwPShTK+NurfI9+1knCPLDhwIFtpcpyUJ++DO6FpX2hQ9Si86ito2Z4Jea3vj X5tdRaKjuJtSehojh8mRJSqrq2BKSkdvW0LDzoRowWuN4erldFlyxzT7mip9+6UTNYaxvyEwx6i t1Zjif7kbBAQD9Bxc5p+vkJPsG6RPrPF2dBLcgiaNYvPjrbtmikk+i6O4wDs6j+XJd8a7Rslsm/ cH5lmIM/5x2uBervNi2RQHcksnSl84R4y7GxRplr7cnAfQft8q3em4m2oPjBvnjZzQWaLtcODa1 IhWKHVTbRqKRYD/oTo9ocOnHK+jipV0yPCuwNOO+5dReE7KXoBMZVIHAWCTUCA== X-Received: by 2002:a17:90b:5910:b0:352:c762:8c2e with SMTP id 98e67ed59e1d1-358ae811f4fmr16041555a91.13.1772095525565; Thu, 26 Feb 2026 00:45:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Thu, 26 Feb 2026 14:15:12 +0530 X-Gm-Features: AaiRm50kQKcOv-uJVuNkyqfPxnjDUuj_luSyPYC9OsmL5H0PNYB3QG7LxU9lei4 Message-ID: Subject: Re: synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication To: SATYANARAYANA NARLAPURAM Cc: Ashutosh Sharma , Amit Kapila , PostgreSQL-development , PostgreSQL Hackers , shveta malik 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 On Thu, Feb 26, 2026 at 1:54=E2=80=AFPM SATYANARAYANA NARLAPURAM wrote: > > Hi Ashutosh, > > On Wed, Feb 25, 2026 at 11:42=E2=80=AFPM Ashutosh Sharma wrote: >> >> >> 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. > > > If the failover orchestrator cannot ensure standby1 to not get the quorum= committed WAL (from archive or standby2) then the setting ANY 1 (val1, val= 2) is invalid. > This setup also has issues because in your scenario, standby2 is ahead of= the new primary (standby1) and standby2 requires now to rewind to be in sy= nc with the new primary. Additionally, it allowed readers to read data that= was lost at the end of the failover. We ideally need a mechanism to not se= nd WAL to async replicas before the sync replicas commit (honoring syncrhn= ous_standby_names GUC) feature (similar to synchronized_standby_slots). It = could be a different thread on its own. +1 on the overall idea of the patch. I understand the concern raised above that one of the standbys in the quorum (synchronized_standby_slots) might lag behind the logical replica, and a user could potentially failover to such a standby. But I also agree with Amit that configuring failover correctly is ultimately the responsibility of failover-solution. And instructions in doc should be followed before deciding if a standby is failover-ready or not. As suggested in [1], IMO, it is a reasonably good idea for 'synchronized_standby_slots' to DEFAULT to the value of 'synchronous_standby_names'. That way, even if the user missed to configure 'synchronized_standby_slots' explicitly, we would still have reasonable protection in place. At the same time, if a user intentionally chooses not to configure it, a NULL/NONE value should remain a valid option. [1]: https://www.postgresql.org/message-id/CAJpy0uCZ04ZQFHs-tV5LprkYtSSwtBt= UJW4O%3D0S01yc%2BTRw7EQ%40mail.gmail.com Thanks, Shveta