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 1p03ga-00087L-JU for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Nov 2022 16:42:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p03gZ-0001ib-HB for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Nov 2022 16:42:19 +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 1p03gZ-0001iR-81 for pgsql-hackers@lists.postgresql.org; Tue, 29 Nov 2022 16:42:19 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p03gU-0005Iv-E1 for pgsql-hackers@lists.postgresql.org; Tue, 29 Nov 2022 16:42:18 +0000 Received: by mail-ed1-x532.google.com with SMTP id s12so20555792edd.5 for ; Tue, 29 Nov 2022 08:42:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4f74Y980TZoEwwSyV4G9qAaEgLAtKuPdPJQ/VCwZSOM=; b=Dp2+NS5y2M37d6oysw2H6eChmU8Dp/mj8aORIBieddcQSWedtsmwbaUhBvQbnrIoBT 1Ggs8+GKZ9bwE/+Xgtk2VveavgHTvE4miHc7ohTQjqLgWSBukFqO6sgUNHev1x/VGCSu mH66h9gwa2xdPBquWNU2zJEnuuMKn4pbbcWuE1ZGPP+AwGC4oEQC1B5sjAnjO26W2rci zQ3nfsuzLqgH+88Ghgev//kJXl60l6H+PXpSBRKhi3+1bCSzVE+gxyYcmWBouXPvVx6Q pAIBspIsgpBVmcfGkxS8m/GDKzogM2y/E2Q01Ep7KQDnQjTqHzP5qKfOXYxYrLN/+WV0 /W8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4f74Y980TZoEwwSyV4G9qAaEgLAtKuPdPJQ/VCwZSOM=; b=6m2Bn/rUNql6daOw5z2xy07vxdbYbksPP5TnGAIjebzk6kUQkLKXq7RK5KyL/4XlH0 GkrBfddWT8LiXBfZt0aYshkTsuk8mhycUa6G4Ia+bMQR/YZdB/Lj2AES2EIdXJicYjFu Ig41ajMB0qotc7tUR0GfCNLfsSO1z/vRENwRN+6iPZQYfeJEFHY+FW6v3hE1Asg+aeRz uO53nd81wiDTadW5+yJwwhpxU37A464V620j+M8FebKbW7FxZ+cTJM/URYK9B8LKEUBb KmqdAvdXdGDXpvzgPMM640+l6+dbZ22MiQI6rOkOnbC6bGe/TbJD1oZFFmYRoN9kJ9aE iCGA== X-Gm-Message-State: ANoB5pmEku5v02pymwnqmSRkpJDGNQ6r0VJj/jwJk277C7ABl/gQY44h K4FP3aUk8vwTa/wyHzo60gTZGQkDj4UW6snRWnM= X-Google-Smtp-Source: AA0mqf5F08SoLoclqFVs75oIDfzWwHiAaRd8PhS54pyenMGSmQUksccJRSPNhXF3L633XBNS7orTZp4qi44nWtUwC3o= X-Received: by 2002:a05:6402:321e:b0:469:ebc0:2247 with SMTP id g30-20020a056402321e00b00469ebc02247mr33024971eda.217.1669740132955; Tue, 29 Nov 2022 08:42:12 -0800 (PST) MIME-Version: 1.0 References: <20220805.114916.994654810780821553.horikyota.ntt@gmail.com> <20220809.161236.1486509314201074910.horikyota.ntt@gmail.com> In-Reply-To: From: SATYANARAYANA NARLAPURAM Date: Tue, 29 Nov 2022 08:42:01 -0800 Message-ID: Subject: Re: An attempt to avoid locally-committed-but-not-replicated-to-standby-transactions in synchronous replication To: Bruce Momjian Cc: Andrey Borodin , Bharath Rupireddy , Kyotaro Horiguchi , Laurenz Albe , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="0000000000007dfba505ee9eab09" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007dfba505ee9eab09 Content-Type: text/plain; charset="UTF-8" On Tue, Nov 29, 2022 at 8:29 AM Bruce Momjian wrote: > On Tue, Nov 29, 2022 at 08:14:10AM -0800, SATYANARAYANA NARLAPURAM wrote: > > 2. Process proc die immediately when a backend is waiting for sync > > replication acknowledgement, as it does today, however, upon restart, > > don't open up for business (don't accept ready-only connections) > > unless the sync standbys have caught up. > > > > > > Are you planning to block connections or queries to the database? It > would be > > good to allow connections and let them query the monitoring views but > block the > > queries until sync standby have caught up. Otherwise, this leaves a > monitoring > > hole. In cloud, I presume superusers are allowed to connect and monitor > (end > > customers are not the role members and can't query the data). The same > can't be > > true for all the installations. Could you please add more details on your > > approach? > > I think ALTER SYSTEM should be allowed, particularly so you can modify > synchronous_standby_names, no? Yes, Change in synchronous_standby_names is expected in this situation. IMHO, blocking all the connections is not a recommended approach. > > -- > Bruce Momjian https://momjian.us > EDB https://enterprisedb.com > > Embrace your flaws. They make you human, rather than perfect, > which you will never be. > --0000000000007dfba505ee9eab09 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Nov 29, 2022 at 8:29 AM Bruce Momjian <bruce@momjian.us> wrote:
On Tue, Nov 29, 2022 at 08:14:10AM -0800, SATYANA= RAYANA NARLAPURAM wrote:
>=C2=A0 =C2=A0 =C2=A02. Process proc die immediately when a backend is w= aiting for sync
>=C2=A0 =C2=A0 =C2=A0replication acknowledgement, as it does today, howe= ver, upon restart,
>=C2=A0 =C2=A0 =C2=A0don't open up for business (don't accept re= ady-only connections)
>=C2=A0 =C2=A0 =C2=A0unless the sync standbys have caught up.
>
>
> Are you planning to block connections or queries to the database? It w= ould be
> good to allow connections and let them query the monitoring views but = block the
> queries until sync standby have caught up. Otherwise, this leaves a mo= nitoring
> hole. In cloud, I presume superusers are allowed to connect and monito= r (end
> customers are not the role members and can't query the data). The = same can't be
> true for all the installations. Could you please add more details on y= our
> approach?

I think ALTER SYSTEM should be allowed, particularly so you can modify
synchronous_standby_names, no?

Yes, Change in synchronous_standby_names is expected in this = situation. IMHO, blocking all the connections is not a recommended approach= .



--
=C2=A0 Bruce Momjian=C2=A0 <bruce@momjian.us>=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://momjian.us=
=C2=A0 EDB=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 https:= //enterprisedb.com

Embrace your flaws.=C2=A0 They make you human, rather than perfect,
which you will never be.
--0000000000007dfba505ee9eab09--