Re: [HACKERS] Time based lag tracking for logical replication - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: [HACKERS] Time based lag tracking for logical replication
Date
Msg-id CANP8+jLFodS1EiZuLu8E9CDZp_x_1U2yXM2=ej_HFtEH3xA-Zg@mail.gmail.com
Whole thread Raw
In response to [HACKERS] Time based lag tracking for logical replication  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
Responses Re: [HACKERS] Time based lag tracking for logical replication  (Thomas Munro <thomas.munro@enterprisedb.com>)
Re: [HACKERS] Time based lag tracking for logical replication  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
Re: [HACKERS] Time based lag tracking for logical replication  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
On 23 April 2017 at 01:10, Petr Jelinek <petr.jelinek@2ndquadrant.com> wrote:
> Hi,
>
> The time based lag tracking commit [1] added interface for logging
> progress of replication so that we can report lag as time interval
> instead of just bytes. But the patch didn't contain patch for the
> builtin logical replication.
>
> So I wrote something that implements this. I didn't like all that much
> the API layering in terms of exporting the walsender's LagTrackerWrite()
> for use by plugin directly. Normally output plugin does not have to care
> if it's running under walsender or not, it uses abstracted write
> interface for that which can be implemented in various ways (that's how
> we implement SQL interface to logical decoding after all). So I decided
> to add another function to the logical decoding write api called
> update_progress and call that one from the output plugin. The walsender
> then implements that new API to call the LagTrackerWrite() while the SQL
> interface just does not implement it at all. This seems like cleaner way
> of doing it.
>
> Thoughts?

Agree cleaner.

I don't see any pacing or comments about it, nor handling of
intermediate messages while we process a large transaction.

I'll look at adding some pacing code in WalSndUpdateProgress()

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] Logical replication - TRAP: FailedAssertion in pgstat.c
Next
From: Thomas Munro
Date:
Subject: Re: [HACKERS] Time based lag tracking for logical replication