Re: Add a GUC variable that control logical replication

From: Quan Zongliang <zongliang(dot)quan(at)postgresdata(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Euler Taveira <euler(at)timbira(dot)com(dot)br>
Cc: Quan Zongliang <zongliang(dot)quan(at)postgresdata(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add a GUC variable that control logical replication
Date: 2019-11-06 14:01:43
Message-ID: 84ba5bef-4c60-43e5-c722-d2f1a4e7de6d@postgresdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019/11/1 20:49, Peter Eisentraut wrote:
> On 2019-10-20 00:23, Euler Taveira wrote:
>>> You can probably achieve that using ALTER PUBLICATION to disable
>>> publication of deletes or truncates, as the case may be, either
>>> permanently or just for the duration of the operations you want to skip.
>>>
>> ... then you are skipping all tables in the publication.
>
> You can group tables into different publications and set the
> subscription to subscribe to multiple publications if you need this kind
> of granularity.
>
> In any case, this kind of thing needs to be handled by the decoding
> plugin based on its configuration policies and depending on its needs.
> For example, let's say you have two decoding plugins running: one for a
> replication system and one for writing an audit log.  It would not be
> appropriate to disable logging for both of them because of some
> performance optimization for one of them.  And it would also not be
> appropriate to do this with a USERSET setting.
>
> If we need different hooks or more DDL commands do this better, then
> that can be considered.  But this seems to be the wrong way to do it.
>

What the user needs is the same replication link that selectively skips
some transactions. And this choice only affects transactions that are
doing bulk delete sessions. The operations of other sessions are not
affected and can continue to output replication messages.
For example, session 1 wants to bulk delete 1 million old data from the
T1 table, which can be done without replication. At the same time,
session 2 deletes 10 records from T1, which is expected to be passed on
through replication.
Therefore, the two decoders can not meet this requirement. It is also
inappropriate to temporarily disable subscriptions because it skips all
transactions for a certain period of time.

--
权宗亮
神州飞象(北京)数据科技有限公司
我们的力量源自最先进的开源数据库PostgreSQL
zongliang(dot)quan(at)postgresdata(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2019-11-06 14:36:29 Re: [HACKERS] Block level parallel vacuum
Previous Message Tom Lane 2019-11-06 13:59:45 Re: dropdb --force