Re: track_commit_timestamp and COMMIT PREPARED

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: track_commit_timestamp and COMMIT PREPARED
Date: 2015-09-28 16:59:14
Message-ID: CA+TgmoZSRKP3RhmoK870CzBZjKfysfSOHR7++4+P8tEjMJn9Sg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 18, 2015 at 12:53 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Sat, Sep 5, 2015 at 7:48 PM, Petr Jelinek <petr(at)2ndquadrant(dot)com> wrote:
>> On 2015-09-02 16:14, Fujii Masao wrote:
>>>
>>> On Wed, Aug 5, 2015 at 2:16 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>>>
>>>> On Mon, Aug 3, 2015 at 10:31 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
>>>> wrote:
>>>>>
>>>>> track_commit_timestamp tracks COMMIT PREPARED as expected in standby
>>>>> server,
>>>>> but not in master server. Is this intentional? It should track COMMIT
>>>>> PREPARED
>>>>> even in master? Otherwise, we cannot use commit_timestamp feature to
>>>>> check
>>>>> the replication lag properly while we use 2PC.
>>>>
>>>>
>>>> That sounds like it must be a bug. I think you should add it to the
>>>> open items list.
>>>
>>>
>>
>> Attached fixes this. It includes advancement of replication origin as well.
>> I didn't feel like doing refactor of commit code this late in 9.5 cycle
>> though, so I went with the code duplication + note in xact.c.
>
> Agreed. We can refactor the code later if needed.
>
> The patch looks good to me except the following minor points.
>
> * or not. Normal path through RecordTransactionCommit() will be related
> * to a transaction commit XLog record, and so should pass "false" here.
>
> The above source comment of TransactionTreeSetCommitTsData() seems to
> need to be updated.
>
> + * Note: if you change this functions you should also look at
> + * RecordTransactionCommitPrepared in twophase.c.
>
> Typo: "this functions" should be "this function"
>
> + if (replorigin_sesssion_origin == InvalidRepOriginId ||
>
> This is not the problem of the patch, but I started wondering what
> "sesssion" in the variable name "replorigin_sesssion_origin" means.
> Is it just a typo and it should be "session"? Or it's the abbreviation
> of something?

This should go in before beta. Is someone updating the patch?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2015-09-28 17:00:33 Re: No Issue Tracker - Say it Ain't So!
Previous Message Andres Freund 2015-09-28 16:43:52 Re: No Issue Tracker - Say it Ain't So!