Re: Issues in Replication Progress Tracking

From: Andres Freund <andres(at)anarazel(dot)de>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Issues in Replication Progress Tracking
Date: 2015-05-22 17:50:21
Message-ID: 20150522175021.GI2028@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-05-21 09:40:58 +0530, Amit Kapila wrote:
> On Thu, May 21, 2015 at 12:42 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> >
> > On 2015-05-20 19:27:05 +0530, Amit Kapila wrote:
> >
> > > 13.
> > > In function replorigin_session_setup() and or
> > > replorigin_session_advance(), don't we need to WAL log the
> > > use of Replication state?
> >
> > No, the point is that the replication progress is persisted via an extra
> > data block in the commit record. That's important for both performance
> > and correctness, because otherwise it gets hard to tie a transaction
> > made during replay with the update to the progress. Unless you use 2PC
> > which isn't really an alternative.
> >
>
> Okay, but what triggered this question was the difference of those functions
> as compare to when user call function pg_replication_origin_advance().
> pg_replication_origin_advance() will WAL log the information during that
> function call itself (via replorigin_advance()). So even if the transaction
> issuing pg_replication_origin_advance() function will abort, it will still
> update
> the Replication State, why so?

I don't see a problem here. pg_replication_origin_advance() is for
setting up the initial position/update the position upon configuration
changes. It'd be a fair amount of infrastructure to make it tie into
transactions - without a point to it afaics?

(Just to be clear, I plan to address all the points I've not commented
upon)

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2015-05-22 18:01:05 Re: Add a hint when postgresql.conf hot_standby = 'off' and recovery.conf standby = 'on'
Previous Message Merlin Moncure 2015-05-22 16:51:29 Re: [PATCH] Generalized JSON output functions