Re: cheaper snapshots

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>
Cc: "Hannu Krosing" <hannu(at)2ndquadrant(dot)com>, <pgsql-hackers(at)postgresql(dot)org>,"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: cheaper snapshots
Date: 2011-07-29 13:52:58
Message-ID: 4E3274EA020000250003F8B6@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-07-29 13:55:46 Re: error: could not find pg_class tuple for index 2662
Previous Message Nikhil Sontakke 2011-07-29 13:49:52 Re: Check constraints on partition parents only?