Re: PATCH: 9.5 replication origins fix for logical decoding - Mailing list pgsql-hackers

From Andres Freund
Subject Re: PATCH: 9.5 replication origins fix for logical decoding
Date
Msg-id 20151015094312.GC6851@awork2.anarazel.de
Whole thread Raw
In response to Re: PATCH: 9.5 replication origins fix for logical decoding  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: PATCH: 9.5 replication origins fix for logical decoding  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
On 2015-10-15 17:05:33 +0800, Craig Ringer wrote:
> On 15 October 2015 at 16:48, Andres Freund <andres@anarazel.de> wrote:
> > On 2015-10-15 16:02:23 +0800, Craig Ringer wrote:
> >> There's an oversight in replication origins support in logical
> >> decoding, where the origin node ID isn't passed correctly to callbacks
> >> except for the origin filter callback. All other callbacks see it as
> >> InvalidRepOriginId.
> >
> > Only for the transaction, right? I.e. the stuff on changes should be
> > correct? Your description sounds like it's more than that?
> >
> > I don't think your fix is entirely correct, the
> > XLogRecGetOrigin(buf->record) shouldn't be in the XACT_XINFO_HAS_ORIGIN
> > block.
> 
> I guess since it'll be InvalidRepOriginId otherwise, that makes sense.

That's not the point. XACT_XINFO_HAS_ORIGIN is about
origin_lsn/timestamp, it doesn't have anything to do with the record
origin (which is included in many more types of record than just
commits).

> > Your test prints the origins from the transaction instead the changes -
> > why?
> 
> I don't understand this part.

Your test prints origin in commits - but changes can have individual
origins.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: FattahRozzaq
Date:
Subject: How to import PostgreSQL 9.2.4 dump to PostgreSQL 9.4.5?
Next
From: Victor Wagner
Date:
Subject: Re: Patch: Implement failover on libpq connect level.