Re: tracking commit timestamps - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: tracking commit timestamps
Date
Msg-id CA+U5nMJKfOE1tLFUbg+n1a4qa_-vcFm-rFdk0gc1rZDgk3VsNw@mail.gmail.com
Whole thread Raw
In response to Re: tracking commit timestamps  (Steve Singer <steve@ssinger.info>)
Responses Re: tracking commit timestamps  (Petr Jelinek <petr@2ndquadrant.com>)
Re: tracking commit timestamps  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 9 November 2014 16:57, Steve Singer <steve@ssinger.info> wrote:
> On 11/07/2014 07:07 PM, Petr Jelinek wrote:
>
>
>> The list of what is useful might be long, but we can't have everything
>> there as there are space constraints, and LSN is another 8 bytes and I still
>> want to have some bytes for storing the "origin" or whatever you want to
>> call it there, as that's the one I personally have biggest use-case for.
>> So this would be ~24bytes per txid already, hmm I wonder if we can pull
>> some tricks to lower that a bit.
>>
>
> The reason why Jim and myself are asking for the LSN and not just the
> timestamp is that I want to be able to order the transactions. Jim pointed
> out earlier in the thread that just ordering on timestamp allows for
> multiple transactions with the same timestamp.

I think we need to be clear about the role and function of components here.

Xid timestamps allow a replication system to do post-commit conflict
resolution based upon timestamp, i.e. last update wins. That is
potentially usable by BDR, Slony, xdb and anything else that wants
that.

Ordering transactions in LSN order is very precisly the remit of the
existing logical decoding API. Any user that wishes to see a commits
in sequence can do so using that API. BDR already does this, as do
other users of the decoding API. So Slony already has access to a
useful ordering if it wishes it. We do not need to anything *on this
patch* to enable LSNs for Slony or anyone else. I don't see any reason
to provide the same facility twice, in two different ways.

So in summary... the components are
* Commit LSN order is useful for applying changes - available by
logical decoding
* Commit timestamps and nodeid are useful for conflict resolution -
available from this patch

Both components have been designed in ways that allow multiple
replication systems to use these facilities.

So, -1 to including commit LSN in the SLRU alongside commit timestamp
and nodeid.

-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: "Tomas Vondra"
Date:
Subject: Re: WIP: multivariate statistics / proof of concept
Next
From: Heikki Linnakangas
Date:
Subject: Re: WAL format and API changes (9.5)