Re: cheaper snapshots - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: cheaper snapshots
Date
Msg-id 4E3274EA020000250003F8B6@gw.wicourts.gov
Whole thread Raw
In response to Re: cheaper snapshots  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> 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.
-Kevin


pgsql-hackers by date:

Previous
From: Nikhil Sontakke
Date:
Subject: Re: Check constraints on partition parents only?
Next
From: Tom Lane
Date:
Subject: Re: error: could not find pg_class tuple for index 2662