pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexey Kondratov <a.kondratov@postgrespro.ru>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Andrey V. Lepikhov <a.lepikhov@postgrespro.ru>
Cc: tsunakawa.takay@fujitsu.com, movead.li@highgo.ca, 'Amit Kapila' <amit.kapila16@gmail.com>
Cc: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: PostgreSQL-Dev <pgsql-hackers@postgresql.org>
Subject: Re: Global snapshots
Date: Thu, 10 Sep 2020 17:22:27 +0300
Message-ID: <c9a5c774eb9b5fb98d9a07c1ef1490b7@postgrespro.ru> (raw)
In-Reply-To: <b5ea3797-0bcc-7288-ba76-119a423dd693@oss.nttdata.com>
References: <07b2c899-4ed0-4c87-1327-23c750311248@postgrespro.ru>
	<CA+fd4k6oZtO-MFYmunHVecGaTWre8YKDNTSfX9hZhQh6Kui1kA@mail.gmail.com>
	<CAA4eK1JVsMWUD4q-b+vawehFzJb6Qg0AOGq7qOGL_gm6EEhdJg@mail.gmail.com>
	<CA+fd4k6HE8xLGEvqWzABEg8kkju5MxU+if7bf-md0_2pjzXp9Q@mail.gmail.com>
	<CAA4eK1+tMDXU9WtQ0kRgyk1jPr+K-7FowMdFB8=t-ptUEQa-mQ@mail.gmail.com>
	<CA+fd4k6YTa25VxpsqvpvqZmsCErT5T8=MYNNDXt7Wn0DsJvSrg@mail.gmail.com>
	<CAA4eK1KAB=YbvDd3a8g2qNj2QNrQANnrpNmoaNCtEMLfaiFjrg@mail.gmail.com>
	<TYAPR01MB2990E83F9E886A9C8AB8E269FE760@TYAPR01MB2990.jpnprd01.prod.outlook.com>
	<TYAPR01MB29902D8B671A5A6946F5AEA8FE720@TYAPR01MB2990.jpnprd01.prod.outlook.com>
	<806c3708-26ea-b94d-87b1-d48e41e93726@postgrespro.ru>
	<3ef7877bfed0582019eab3d462a43275@postgrespro.ru>
	<057004b6-68bf-98ee-7c57-91c418f6e221@oss.nttdata.com>
	<0e51d0298eed7588664e3c67a4fb15c9@postgrespro.ru>
	<a86f7722-48b3-cd82-d491-86272a7bf8f0@oss.nttdata.com>
	<53b1586317ae98ecd8c3383f2c9e7c16@postgrespro.ru>
	<b5ea3797-0bcc-7288-ba76-119a423dd693@oss.nttdata.com>

On 2020-09-09 20:29, Fujii Masao wrote:
> On 2020/09/09 2:00, Alexey Kondratov wrote:
>> 
>> According to the Sawada-san's v25 0002 the logic is pretty much the 
>> same there:
>> 
>> +2. Pre-Commit phase (1st phase of two-phase commit)
>> 
>> +3. Commit locally
>> +Once we've prepared all of them, commit the transaction locally.
>> 
>> +4. Post-Commit Phase (2nd phase of two-phase commit)
>> 
>> Brief look at the code confirms this scheme. IIUC, AtEOXact_FdwXact / 
>> FdwXactParticipantEndTransaction happens after 
>> ProcArrayEndTransaction() in the CommitTransaction(). Thus, I don't 
>> see many difference between these approach and CallXactCallbacks() 
>> usage regarding this point.
> 
> IIUC the commit logic in Sawada-san's patch looks like
> 
> 1. PreCommit_FdwXact()
>     PREPARE TRANSACTION command is issued
> 
> 2. RecordTransactionCommit()
>     2-1. WAL-log the commit record
>     2-2. Update CLOG
>     2-3. Wait for sync rep
>     2-4. FdwXactWaitForResolution()
>             Wait until COMMIT PREPARED commands are issued to the
> remote servers and completed.
> 
> 3. ProcArrayEndTransaction()
> 4. AtEOXact_FdwXact(true)
> 
> So ISTM that the timing of when COMMIT PREPARED is issued
> to the remote server is different between the patches.
> Am I missing something?
> 

No, you are right, sorry. At a first glance I thought that 
AtEOXact_FdwXact is responsible for COMMIT PREPARED as well, but it is 
only calling FdwXactParticipantEndTransaction in the abort case.


Regards
-- 
Alexey Kondratov

Postgres Professional https://www.postgrespro.com
Russian Postgres Company





view thread (77+ messages)  latest in thread

Message-ID: <c9a5c774eb9b5fb98d9a07c1ef1490b7@postgrespro.ru>
Permalink:  ../c9a5c774eb9b5fb98d9a07c1ef1490b7@postgrespro.ru/
Also on:    postgresql.org/message-id/c9a5c774eb9b5fb98d9a07c1ef1490b7@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: a.kondratov@postgrespro.ru, masao.fujii@oss.nttdata.com, a.lepikhov@postgrespro.ru, amit.kapila16@gmail.com, masahiko.sawada@2ndquadrant.com
  Subject: Re: Global snapshots
  In-Reply-To: <c9a5c774eb9b5fb98d9a07c1ef1490b7@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox