Re: tracking commit timestamps

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Petr Jelinek <petr(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, 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-01 13:00:40
Message-ID: CAB7nPqSTsuJj1oL9fYMXHAgNDXnkoKX3vMQmL6hp=PNvRHfM+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-www

On Sat, Nov 1, 2014 at 1:45 PM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> I am still planning to do more extensive tests, and study a bit more
> committs.c (with even more comments) as it is the core part of the feature.
>
More comments:
- Heikki already mentioned it, but after reading the code I see little
point in having the extra field implementing like that in core for many
reasons even if it is *just* 4 bytes:
1) It is untested and actually there is no direct use for it in core.
2) Pushing code that we know as dead is no good, that's a feature more or
less defined as maybe-useful-but-we-are-not-sure-yet-what-to-do-with-it.
3) If you're going to re-use this API in BDR, which is a fork of Postgres.
You'd better complete this API in BDR by yourself and not bother core with
that.
For those reasons I think that this extra field should be ripped off from
the patch.
- The API to get the commit timestamp is not that user-friendly, and I
think it could really be improved, to something like that for example:
pg_get_commit_timestamp(from_xact xid, number_of_xacts int);
pg_get_commit_timestamp(from_xact xid);
pg_get_commit_timestamp(); or pg_get_latest_commit_timestamp();
from_xact to NULL means latest. number_of_xacts to NULL means 1.
Comment in line with the fact that extra field is well, not really useful.
Regards,
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2014-11-01 13:30:38 Re: pgsql: Support frontend-backend protocol communication using a shm_mq.
Previous Message Michael Paquier 2014-11-01 12:29:29 Re: tracking commit timestamps

Browse pgsql-www by date

  From Date Subject
Next Message Petr Jelinek 2014-11-01 13:41:02 Re: tracking commit timestamps
Previous Message Michael Paquier 2014-11-01 12:29:29 Re: tracking commit timestamps