Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Kevin Grittner
On Tue, Aug 23, 2016 at 11:50 AM, Andres Freund wrote: > On 2016-08-23 07:26:31 -0500, Kevin Grittner wrote: >> On Tue, Aug 23, 2016 at 7:10 AM, Kevin Grittner wrote: >> > On Mon, Aug 22, 2016 at 6:39 PM, Craig Ringer >> > wrote: >>

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Craig Ringer
On 24 August 2016 at 00:50, Andres Freund wrote: > On 2016-08-23 07:26:31 -0500, Kevin Grittner wrote: > > On Tue, Aug 23, 2016 at 7:10 AM, Kevin Grittner > wrote: > > [an explanation of SSI anomalies] > I've generally a bit of difficulty to see this as a

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Andres Freund
On 2016-08-23 07:26:31 -0500, Kevin Grittner wrote: > On Tue, Aug 23, 2016 at 7:10 AM, Kevin Grittner wrote: > > On Mon, Aug 22, 2016 at 6:39 PM, Craig Ringer wrote: > > >> Could you provide an example of a case where xacts replayed in > >> commit order

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Craig Ringer
On 24 August 2016 at 00:26, Kevin Grittner wrote: > On Tue, Aug 23, 2016 at 9:36 AM, Kevin Grittner wrote: > > On Tue, Aug 23, 2016 at 9:07 AM, Kevin Grittner > wrote: > >> On Tue, Aug 23, 2016 at 7:40 AM, Craig Ringer

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Kevin Grittner
On Tue, Aug 23, 2016 at 9:36 AM, Kevin Grittner wrote: > On Tue, Aug 23, 2016 at 9:07 AM, Kevin Grittner wrote: >> On Tue, Aug 23, 2016 at 7:40 AM, Craig Ringer wrote: >>> On 23 Aug 2016 20:10, "Kevin Grittner"

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Petr Jelinek
On 23/08/16 15:59, Robert Haas wrote: On Mon, Aug 22, 2016 at 4:32 PM, Andres Freund wrote: On 2016-08-22 16:29:12 -0400, Robert Haas wrote: So, I wish I could give you some better advice on this topic, but sadly I am not an expert in this area. However, it seems to me

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Kevin Grittner
On Tue, Aug 23, 2016 at 9:07 AM, Kevin Grittner wrote: > On Tue, Aug 23, 2016 at 7:40 AM, Craig Ringer wrote: >> On 23 Aug 2016 20:10, "Kevin Grittner" wrote: >>> >>> On Mon, Aug 22, 2016 at 6:39 PM, Craig Ringer

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Kevin Grittner
On Tue, Aug 23, 2016 at 7:40 AM, Craig Ringer wrote: > On 23 Aug 2016 20:10, "Kevin Grittner" wrote: >> >> On Mon, Aug 22, 2016 at 6:39 PM, Craig Ringer >>> Could you provide an example of a case where xacts replayed in >>>

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Robert Haas
On Mon, Aug 22, 2016 at 4:32 PM, Andres Freund wrote: > On 2016-08-22 16:29:12 -0400, Robert Haas wrote: >> So, I wish I could give you some better advice on this topic, but >> sadly I am not an expert in this area. However, it seems to me that >> this is just one facet of a

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Craig Ringer
On 23 Aug 2016 20:10, "Kevin Grittner" wrote: > > On Mon, Aug 22, 2016 at 6:39 PM, Craig Ringer wrote: > > On 23 Aug 2016 05:43, "Kevin Grittner" wrote: > >> On Mon, Aug 22, 2016 at 3:29 PM, Robert Haas wrote:

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Kevin Grittner
On Tue, Aug 23, 2016 at 7:10 AM, Kevin Grittner wrote: > On Mon, Aug 22, 2016 at 6:39 PM, Craig Ringer wrote: >> Could you provide an example of a case where xacts replayed in >> commit order will produce incorrect results? > >

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-23 Thread Kevin Grittner
On Mon, Aug 22, 2016 at 6:39 PM, Craig Ringer wrote: > On 23 Aug 2016 05:43, "Kevin Grittner" wrote: >> On Mon, Aug 22, 2016 at 3:29 PM, Robert Haas wrote: >> >>> it seems to me that >>> this is just one facet of a much more

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-22 Thread Craig Ringer
On 23 Aug 2016 05:43, "Kevin Grittner" wrote: > > On Mon, Aug 22, 2016 at 3:29 PM, Robert Haas 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

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-22 Thread Kevin Grittner
On Mon, Aug 22, 2016 at 3:29 PM, Robert Haas 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

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-22 Thread Andres Freund
On 2016-08-22 16:29:12 -0400, Robert Haas wrote: > So, I wish I could give you some better advice on this topic, but > sadly I am not an expert in this area. However, 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

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-22 Thread Robert Haas
On Sun, Aug 21, 2016 at 11:13 PM, Craig Ringer wrote: > If the sequence is created in the current xact (i.e. uncommitted) we have to > add the sequence updates to that xact to be replayed only if it commits. The > sequence is visible only to the toplevel xact that created

Re: [HACKERS] Logical decoding of sequence advances, part II

2016-08-21 Thread Craig Ringer
On 22 August 2016 at 11:13, Craig Ringer wrote: > So yeah. I think extending SeqTableData and xl_seq_rec with xid is the way > to go. Objections? > Prototyping this shows that re-using SeqTableData to store the creator xid won't work out. We can't just store the

[HACKERS] Logical decoding of sequence advances, part II

2016-08-21 Thread Craig Ringer
Hi all My earlier efforts at logical decoding of sequence advances were too simplistic[1], falling afoul of issues with sequences being both transactional and not transactional depending on whether the sequence is created in the current xact or not. TL;DR of solution: * extend SeqTableData and