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

From Ants Aasma
Subject Re: Reporting the commit LSN at commit time
Date
Msg-id CA+CSw_tLwGQ5yJvRFwV4+hYXgjCpRCvGaZHGhrrR4tdp3rGOpw@mail.gmail.com
Whole thread Raw
In response to Reporting the commit LSN at commit time  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
On Thu, Aug 7, 2014 at 4:15 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
> 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?

I have been thinking about something similar.

For regular streaming replication you could keep track of the commit
LSN on a per client basis and automatically redirect read queries to a
standby if standby apply location is larger than the commit LSN of
this particular client. This can be done mostly transparently for the
application while not running into the issue that recent modifications
disappear for a while after commit.

Regards,
Ants Aasma
--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de



pgsql-hackers by date:

Previous
From: Maxence Ahlouche
Date:
Subject: [GSoC] kmedoids status report
Next
From: Fujii Masao
Date:
Subject: Re: posix_fadvise() and pg_receivexlog