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 1npU6w-0002jJ-R4 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 May 2022 12:09:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1npU6u-0005Z7-Ee for pgsql-hackers@arkaria.postgresql.org; Fri, 13 May 2022 12:09:32 +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 1npU6u-0005Yt-3b for pgsql-hackers@lists.postgresql.org; Fri, 13 May 2022 12:09:32 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1npU6p-0007VC-Lt for pgsql-hackers@lists.postgresql.org; Fri, 13 May 2022 12:09:31 +0000 Received: by mail-pg1-x536.google.com with SMTP id a191so7334136pge.2 for ; Fri, 13 May 2022 05:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=W32fP2g2Zwaa+Ije0ep9WyFMm2tNh5wemDkxTH9fjKk=; b=gZeVzvhlY2fgMMU0H4UjJVDb+8XWr6UDIko+nX5nc598WY2gXu89rlC1CSUxc3LtQI FpOUsQXVtdtGgaby6QV6h4R3NZwK0kToWeIlnVXk8A2/MpoDSa44khrDu6kDn4PcIPSD aydZ7EZaKWFSvBP6CnOPijNWklU0ActyVG5y2DoyGcgEVo8NqP4xyJR3qYAz8xTWbGYX +KVyVAtXTee13dDSMc0e/eXsTXOpQtYQTnibfWMx/5UN6x+01l7EpqDgEwhy612WbGBq bw07okNl89wj5CBilsIDEgCUvpS2ff34/cZIpHvy2nPROaxrqO4AZ2D2arHb8d/Hieuj 8QMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=W32fP2g2Zwaa+Ije0ep9WyFMm2tNh5wemDkxTH9fjKk=; b=DkfF+3r9MOCF0TZbCo6mhEGWDlIgDxBE8xz/PNZJIOwzJ3gzlAVTpBJDBF9qZSaQ0b td74VRIR5Nmu6U5iKimGIh87l0+E5JYzRQbvxbRfA/4cdjmCyGlaOfWuFEQAHGgqX9ey /4RjEQHcdF9PSW3zIFXf+JvfxPmoXopnLptHw0C6YfieR9+tuTi29Sz9NteHNCTTKtcz H+0dryCmUUFNNrj8R3HAjR3v1/PhpKjIay6LiPE2xte2Ac4+kaH9WoU2MibiaTB2dgPm c4l/HmQ/EcgdCHPElCe5HGje70jzvYTUsCbnOAAUYp8JYTlyzOKznxQ55aDu06FBzbLs c7sg== X-Gm-Message-State: AOAM532nsah4Ada9AraYlJJpjjaku9ZOQwwls5VweOUdoTmD5CFBc7sr rgpUPYdSVXAsjm3qkPgTSxgzzN8aa95M3TMAyzc= X-Google-Smtp-Source: ABdhPJzw8gRxlBin6IkjIDb8qLlwQsys9b/dsZOzvwxm7JSrcbSc4LUq5qRCNg0ypPSE5U+cI1l+IUEdWk8AkLMSsmk= X-Received: by 2002:a63:5551:0:b0:3ab:84c3:1a0 with SMTP id f17-20020a635551000000b003ab84c301a0mr3854821pgm.604.1652443765140; Fri, 13 May 2022 05:09:25 -0700 (PDT) MIME-Version: 1.0 References: <9290b55b6ae2b04e002ca9dadadd1cca09461482.camel@cybertec.at> <763B5AF0-1C9E-4796-9639-F969A2E66189@yandex-team.ru> <11FF616C-C78C-41AA-A823-E3D4E745ACE5@yandex-team.ru> In-Reply-To: <11FF616C-C78C-41AA-A823-E3D4E745ACE5@yandex-team.ru> From: Bharath Rupireddy Date: Fri, 13 May 2022 17:39:12 +0530 Message-ID: Subject: Re: An attempt to avoid locally-committed-but-not-replicated-to-standby-transactions in synchronous replication To: Andrey Borodin Cc: Dilip Kumar , Laurenz Albe , PostgreSQL Hackers , SATYANARAYANA NARLAPURAM 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 Tue, May 10, 2022 at 5:55 PM Andrey Borodin wrote= : > > > 10 =D0=BC=D0=B0=D1=8F 2022 =D0=B3., =D0=B2 12:59, Bharath Rupireddy =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0= =D0=BB(=D0=B0): > > > > If okay, I can make the GUC behave this way - value 0 existing > > behaviour i.e. no wait for sync repl ack, just process query cancels > > and proc die interrupts immediately; value -1 wait unboundedly for the > > ack; value > 0 wait for specified milliseconds for the ack. > +1 if we make -1 and 0 only valid values. > > > query cancels or proc die interrupts > > Please note, that typical HA tool would need to handle query cancels and = proc die interrupts differently. Agree. > When the network is partitioned and somewhere standby is promoted you def= initely want infinite wait for cancels. When standby is promoted, no point the old primary waiting forever for ack assuming we are going to discard it. > Yet once upon a time you want to shutdown postgres without coredump - thu= s proc die needs to be processed. I think users can still have the flexibility to set the right amounts of time to process cancel and proc die interrupts. IMHO, the GUC can still have 0, -1 and value > 0 in milliseconds, let the users decide on what they want. Do you see any problems with this? Thoughts? Regards, Bharath Rupireddy.