Time based lag tracking for logical replication

From: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Subject: Time based lag tracking for logical replication
Date: 2017-04-22 23:10:32
Message-ID: 2a822515-82a2-6374-a131-1f99054cf5f6@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
Add-support-for-time-based-lag-tracking-to-logical-r.patch binary/octet-stream 12.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2017-04-22 23:15:29 Remove dead interfaces added by mistake in 7c4f52409
Previous Message Daniel Gustafsson 2017-04-22 22:48:42 Re: A note about debugging TAP failures