From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Petr Jelinek <petr@2ndquadrant.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: [COMMITTERS] pgsql: Keep track of transaction commit timestamps
Date: Thu, 4 Dec 2014 14:26:46 +0200
Message-ID: <54805306.4030100@vmware.com> (raw)
In-Reply-To: <548049D5.1000605@2ndquadrant.com>
References: <E1XwBJu-0000Oh-PA@gemulon.postgresql.org>
<54802C7F.90606@vmware.com>
<5480427A.1080200@2ndquadrant.com>
<548044CF.5010809@vmware.com>
<548049D5.1000605@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 12/04/2014 01:47 PM, Petr Jelinek wrote:
> On 04/12/14 12:26, Heikki Linnakangas wrote:
>> On 12/04/2014 01:16 PM, Petr Jelinek wrote:
>>> On 04/12/14 10:42, Heikki Linnakangas wrote:
>>>> On 12/03/2014 04:54 PM, Alvaro Herrera wrote:
>>>>> ir commit timestamp directly as they commit,
>>>>> or an external transaction c
>>>>
>>>> Sorry, I'm late to the party, but here's some random comments on this
>>>> after a quick review:
>>>>
>>>> * The whole concept of a node ID seems to be undocumented, and unused.
>>>> No-one calls CommitTsSetDefaultNodeId(). The whole SET_TS record type is
>>>> dead code too, when a non-default node_id is not set. Please remove, or
>>>> explain how all that's supposed to work.
>>>
>>> That's API meant to be used by extensions, maybe it would be preferable
>>> if there was SQL API exposed also?
>>>
>>> (It might also make more sense once replication identifiers are
>>> submitted.)
>>
>> Maybe. Hard to tell without any documentation or comments on how it's
>> supposed to work. In unacceptable in its current state.
>>
>> I would prefer to remove it now, and add it back later together with the
>> code that actually uses it. I don't like having unused internal
>> functions and APIs sitting the source tree in the hope that someone will
>> find them useful in the future. It's more likely that it will bitrot, or
>> not actually work as intended, when someone later tries to use it.
>
> The thing is I already have extension for 9.4 where I would use this API
> for conflict detection if it was available so it's not about hoping for
> somebody to find it useful. There was discussion about this during the
> review process because the objection was raised already then.
Yeah, it was raised. I don't think it was really addressed. There was
lengthy discussion on whether to include LSN, node id, and/or some other
information, but there was no discussion on:
* What is a node ID?
* How is it used?
* Who assigns it?
etc.
None of those things are explained in the documentation nor code comments.
The node ID sounds suspiciously like the replication identifiers that
have been proposed a couple of times. I don't remember if I like
replication identifiers or not, but I'd rather discuss that issue
explicitly and separately. I don't want the concept of a
replication/node ID to fly under the radar like this.
>> What would the SQL API look like, and what would it be used for?
>
> It would probably mirror the C one, from my POV it's not needed but
> maybe some replication solution would prefer to use this without having
> to write C components...
I can't comment on that, because without any documentation, I don't even
know what the C API is.
BTW, why is it OK that the node-ID of a commit is logged as a separate
WAL record, after the commit record? That means that it's possible that
a transaction commits, but you crash just before writing the SETTS
record, so that after replay the transaction appears committed but with
the default node ID.
(Maybe that's OK given the intended use case, but it's hard to tell
without any documentation. See a pattern here? ;-) )
- Heikki
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: hlinnakangas@vmware.com, petr@2ndquadrant.com, alvherre@alvh.no-ip.org, pgsql-hackers@postgreSQL.org
Subject: Re: [COMMITTERS] pgsql: Keep track of transaction commit timestamps
In-Reply-To: <54805306.4030100@vmware.com>
References: <E1XwBJu-0000Oh-PA@gemulon.postgresql.org> <54802C7F.90606@vmware.com> <5480427A.1080200@2ndquadrant.com> <548044CF.5010809@vmware.com> <548049D5.1000605@2ndquadrant.com> <54805306.4030100@vmware.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox