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 1noOwT-0000Pj-5W for pgsql-hackers@arkaria.postgresql.org; Tue, 10 May 2022 12:26:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1noOvS-00072n-7J for pgsql-hackers@arkaria.postgresql.org; Tue, 10 May 2022 12:25:14 +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 1noOvR-00072R-ND for pgsql-hackers@lists.postgresql.org; Tue, 10 May 2022 12:25:13 +0000 Received: from forwardcorp1p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b6:217]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1noOvL-0002oh-5F for pgsql-hackers@lists.postgresql.org; Tue, 10 May 2022 12:25:12 +0000 Received: from sas1-3cba3404b018.qloud-c.yandex.net (sas1-3cba3404b018.qloud-c.yandex.net [IPv6:2a02:6b8:c08:bd26:0:640:3cba:3404]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id ACDFF2E0D72; Tue, 10 May 2022 15:25:02 +0300 (MSK) Received: from sas1-7470331623bb.qloud-c.yandex.net (sas1-7470331623bb.qloud-c.yandex.net [2a02:6b8:c08:bd1e:0:640:7470:3316]) by sas1-3cba3404b018.qloud-c.yandex.net (mxbackcorp/Yandex) with ESMTP id cIUbvC9xep-P2JqYsTv; Tue, 10 May 2022 15:25:02 +0300 X-Yandex-Fwd: 2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1652185502; bh=lPPQaJGg6i8ylMw44fPRgUO88KGP4QJbBxd6r265pwI=; h=Message-Id:References:Date:Cc:In-Reply-To:Subject:To:From; b=SvbgWODEIBuHceOhWepGQfdARt+C558zcUNDNm9S6OZ7DpJM5kYsnFcWJkpWwvfXi acgS1I/zJcDk/g9uVgFl6lNCpiItF67WGtOAnjDC0a4MQfr0hb/mp+wv41GkSzpVW6 Len8c/FpTrkdQBqOifJN+jSpathc74a1IOx9IuJ8= Authentication-Results: sas1-3cba3404b018.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from [IPv6:2a02:6b8:82:600:94fe:e703:34f2:5da5] (unknown [2a02:6b8:82:600:94fe:e703:34f2:5da5]) by sas1-7470331623bb.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id DSYMJaklGV-P1M4322m; Tue, 10 May 2022 15:25:02 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: An attempt to avoid locally-committed-but-not-replicated-to-standby-transactions in synchronous replication From: Andrey Borodin In-Reply-To: Date: Tue, 10 May 2022 17:25:01 +0500 Cc: Dilip Kumar , Laurenz Albe , PostgreSQL Hackers , SATYANARAYANA NARLAPURAM Content-Transfer-Encoding: quoted-printable Message-Id: <11FF616C-C78C-41AA-A823-E3D4E745ACE5@yandex-team.ru> References: <9290b55b6ae2b04e002ca9dadadd1cca09461482.camel@cybertec.at> <763B5AF0-1C9E-4796-9639-F969A2E66189@yandex-team.ru> To: Bharath Rupireddy X-Mailer: Apple Mail (2.3608.120.23.2.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > 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): >=20 > 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. When the network is partitioned and somewhere standby is promoted you = definitely want infinite wait for cancels. Yet once upon a time you want = to shutdown postgres without coredump - thus proc die needs to be = processed. Thanks! Best regards, Andrey Borodin.=