Re: tracking commit timestamps

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Steve Singer <steve(at)ssinger(dot)info>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Anssi Kääriäinen <anssi(dot)kaariainen(at)thl(dot)fi>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Subject: Re: tracking commit timestamps
Date: 2014-11-26 05:30:55
Message-ID: CAB7nPqSpxcFkZMs7cyYiqmh8j0c2nzx6vY=O3KAkukGKW9cyag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-www

On Wed, Nov 26, 2014 at 1:51 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On 25 November 2014 at 16:18, Petr Jelinek <petr(at)2ndquadrant(dot)com> wrote:
>
>> Won't the pg_last_committed_xact() on slave + pg_xact_commit_timestamp() on
>> master with the xid returned by slave accomplish the same thing?
>
> Surely the pg_last_committed_xact() will return the same value on
> standby as it did on the master?

It should. Now it needs some extra help as well as in its current
shape this patch will WAL log a commit timestamp if the Node ID is
valid, per RecordTransactionCommit. The node ID can be set only
through CommitTsSetDefaultNodeId, which is called nowhere actually. So
if an extension or an extra library needs to do some leg work to have
to allow this information to be replayed on other nodes.
Regards,
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-11-26 06:48:24 Re: Proposal : REINDEX SCHEMA
Previous Message Jeff Janes 2014-11-26 05:30:45 9.2 recovery/startup problems

Browse pgsql-www by date

  From Date Subject
Next Message Charles Clavadetscher 2014-12-01 17:59:08 [SwissPUG] Swiss PostgreSQL Users Group
Previous Message Simon Riggs 2014-11-25 16:51:23 Re: tracking commit timestamps