Robert Haas <> wrote:
>> (4)  We communicate acceptable snapshots to the replica to make
>> the order of visibility visibility match the master even when
>> that doesn't match the order that transactions returned from
>> commit.
>>  I (predictably) like (4) -- even though it's a lot of work....
> I think that (4), beyond being a lot of work, will also have
> pretty terrible performance.  You're basically talking about
> emitting two WAL records for every commit instead of one.
Well, I can think of a great many other ways this could be done,
each with its own trade-offs of various types of overhead against
how close the replica is to current.  At one extreme you could do
what you describe, at the other you could generate a new snapshot on
the replica once every few minutes.
Then there are more clever ways, in discussions a few months ago I
suggested that adding two new bit flags to the commit record would
suffice, and I don't remember anyone blowing holes in that idea.  Of
course, that was to achieve serializable behavior on the replica,
based on some assumption that the current hot standby already
supported repeatable read.  We might need another bit or two to
solve the problems with that which have surfaced on this thread.

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to