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 1kJ1rf-0005b5-I7 for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Sep 2020 21:54:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kJ1rd-00043m-Nx for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Sep 2020 21:54:49 +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 1kJ1rd-00043e-H0 for pgsql-hackers@lists.postgresql.org; Thu, 17 Sep 2020 21:54:49 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJ1rV-0008Df-VV for pgsql-hackers@postgresql.org; Thu, 17 Sep 2020 21:54:48 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kJ1rM-0004BT-4o; Thu, 17 Sep 2020 17:54:32 -0400 Date: Thu, 17 Sep 2020 17:54:32 -0400 From: Bruce Momjian To: Alexey Kondratov Cc: Fujii Masao , "Andrey V. Lepikhov" , tsunakawa.takay@fujitsu.com, movead.li@highgo.ca, 'Amit Kapila' , Masahiko Sawada , PostgreSQL-Dev Subject: Re: Global snapshots Message-ID: <20200917215432.GA24265@momjian.us> References: <806c3708-26ea-b94d-87b1-d48e41e93726@postgrespro.ru> <3ef7877bfed0582019eab3d462a43275@postgrespro.ru> <057004b6-68bf-98ee-7c57-91c418f6e221@oss.nttdata.com> <0e51d0298eed7588664e3c67a4fb15c9@postgrespro.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0e51d0298eed7588664e3c67a4fb15c9@postgrespro.ru> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Sep 8, 2020 at 01:36:16PM +0300, Alexey Kondratov wrote: > Thank you for the link! > > After a quick look on the Sawada-san's patch set I think that there are two > major differences: > > 1. There is a built-in foreign xacts resolver in the [1], which should be > much more convenient from the end-user perspective. It involves huge in-core > changes and additional complexity that is of course worth of. > > However, it's still not clear for me that it is possible to resolve all > foreign prepared xacts on the Postgres' own side with a 100% guarantee. > Imagine a situation when the coordinator node is actually a HA cluster group > (primary + sync + async replica) and it failed just after PREPARE stage of > after local COMMIT. In that case all foreign xacts will be left in the > prepared state. After failover process complete synchronous replica will > become a new primary. Would it have all required info to properly resolve > orphan prepared xacts? > > Probably, this situation is handled properly in the [1], but I've not yet > finished a thorough reading of the patch set, though it has a great doc! > > On the other hand, previous 0003 and my proposed patch rely on either manual > resolution of hung prepared xacts or usage of external monitor/resolver. > This approach is much simpler from the in-core perspective, but doesn't look > as complete as [1] though. Have we considered how someone would clean up foreign transactions if the coordinating server dies? Could it be done manually? Would an external resolver, rather than an internal one, make this easier? -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee