Re: Logical decoding of sequence advances, part II

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Logical decoding of sequence advances, part II
Date: 2016-08-23 12:10:35
Message-ID: CACjxUsMBBjgiMAo=5UAnzPPV78892SM70VaGDzuHS9Q16xDJig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 22, 2016 at 6:39 PM, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
> On 23 Aug 2016 05:43, "Kevin Grittner" <kgrittn(at)gmail(dot)com> wrote:
>> On Mon, Aug 22, 2016 at 3:29 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>
>>> it seems to me that
>>> this is just one facet of a much more general problem: given two
>>> transactions T1 and T2, the order of replay must match the order of
>>> commit unless you can prove that there are no dependencies between
>>> them. I don't see why it matters whether the operations are sequence
>>> operations or data operations; it's just a question of whether they're
>>> modifying the same "stuff".

>> The commit order is the simplest and safest *unless* there is a
>> read-write anti-dependency a/k/a read-write dependency a/k/a
>> rw-conflict: where a read from one transaction sees the "before"
>> version of data modified by the other transaction. In such a case
>> it is necessary for correct serializable transaction behavior for
>> the transaction that read the "before" image to be replayed before
>> the write it didn't see, regardless of commit order. If you're not
>> trying to avoid serialization anomalies, it is less clear to me
>> what is best.
>
> Could you provide an example of a case where xacts replayed in
> commit order will produce incorrect results?

https://wiki.postgresql.org/wiki/SSI#Deposit_Report

... where T3 is on the replication target.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2016-08-23 12:13:33 comment typo lmgr.c
Previous Message Michael Paquier 2016-08-23 11:50:14 Re: LSN as a recovery target