Re: [HACKERS] Speedup twophase transactions - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] Speedup twophase transactions
Date
Msg-id CAB7nPqTKbJXzUOheX9xcF9K6m-G5SmzN5A2CGkRB-_DtQ+dY3w@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Speedup twophase transactions  (Nikhil Sontakke <nikhils@2ndquadrant.com>)
Responses Re: [HACKERS] Speedup twophase transactions
Re: [HACKERS] Speedup twophase transactions
List pgsql-hackers
On Thu, Jan 26, 2017 at 4:09 PM, Nikhil Sontakke
<nikhils@2ndquadrant.com> wrote:
>>I look at this patch from you and that's present for me:
>>https://www.postgresql.org/message-id/CAMGcDxf8Bn9ZPBBJZba9wiyQq->Qk5uqq=VjoMnRnW5s+fKST3w@mail.gmail.com
>
>> --- a/src/backend/access/transam/xlog.c
>> +++ b/src/backend/access/transam/xlog.c
>> @@ -9573,6 +9573,7 @@ xlog_redo(XLogReaderState *record)
>>                      (errmsg("unexpected timeline ID %u (should be %u)
>> in checkpoint record",
>>                              checkPoint.ThisTimeLineID, ThisTimeLineID)));
>>
>> +        KnownPreparedRecreateFiles(checkPoint.redo);
>>          RecoveryRestartPoint(&checkPoint);
>>      }
>
> Oh, sorry. I was asking about CheckpointTwoPhase(). I don't see a
> function by this name. And now I see, the name is CheckPointTwoPhase()
> :-)

My mistake then :D

>> And actually, when a XLOG_CHECKPOINT_SHUTDOWN record is taken, 2PC
>> files are not flushed to disk with this patch. This is a problem as a
>> new restart point is created... Having the flush in CheckpointTwoPhase
>> really makes the most sense.
>
> Umm, AFAICS, CheckPointTwoPhase() does not get called in the "standby
> promote" code path.

CreateRestartPoint() calls it via CheckPointGuts() while in recovery.
-- 
Michael



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Radix tree for character conversion
Next
From: Stas Kelvich
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions