Reporting the commit LSN at commit time - Mailing list pgsql-hackers

From Craig Ringer
Subject Reporting the commit LSN at commit time
Date
Msg-id 53E2D346.9030806@2ndquadrant.com
Whole thread Raw
Responses Re: Reporting the commit LSN at commit time
Re: Reporting the commit LSN at commit time
Re: Reporting the commit LSN at commit time
List pgsql-hackers
Hi all

To support transparent client-side failover in BDR, it's necessary to
know what the LSN of a node was at the time a transaction committed and
keep track of that in the client/proxy.

I'm thinking about adding a new message type in the protocol that gets
sent immediately before CommandComplete, containing the LSN of the
commit. Clients would need to enable the sending of this message with a
GUC that they set when they connect, so it doesn't confuse clients that
aren't expecting it or aware of it.

Is this something you can see being useful for other non-BDR purposes?
Are there any obvious issues with this?


Clients can always follow up with a second query to get the xlog
position, after commit, but that's potentially slow and has a race that
might cause a client to wait longer than it has to after fail-over to a
different node. That's why having the server report it automatically
seems useful.

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



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: B-Tree support function number 3 (strxfrm() optimization)
Next
From: Bruce Momjian
Date:
Subject: Re: Partitioning performance: cache stringToNode() of pg_constraint.ccbin