Re: row filtering for logical replication

From: Alexey Zagarin <zagarin(at)gmail(dot)com>
To: Euler Taveira <euler(at)timbira(dot)com(dot)br>, Erik Rijkers <er(at)xs4all(dot)nl>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Suzuki Hironobu <hironobu(at)interdb(dot)jp>, a(dot)kondratov(at)postgrespro(dot)ru
Subject: Re: row filtering for logical replication
Date: 2019-09-04 01:21:27
Message-ID: c6a2bd52-c5cb-4ca3-aace-ebfe5a330b91@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> OK, I'll consider Alexey Kondratov's set of patches as the current
> state-of-the-art then. (They still apply.)

Alexey's patch is the rebased version of previous Euler's patch set, with slot type mistake fixed, and adapted to current changes in the master branch. It also has testing improvements. On the other hand, the new patches from Euler include more fixes and the implementation of filtering in COPY (as far as I can tell from code) which addresses my particular pain point with BDR. Hope they'll be joined soon. :)

> It turns out this did not work until I added a wait state after the
> CREATE SUBSCRIPTION. It always fails without the wait state, and always
> works with the wait state.
>
> Do you agree this is a bug?

I'm not sure this is a bug as after the subscription is added (or a new table added to the publication and then the subscription is refreshed), the whole table is synchronized using COPY statement. Depending on size of the table it can take some time. You may want to check srsubstate in pg_subscription_rel instead of just sleep for more reliable implementation.

Alexey

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2019-09-04 01:38:07 Re: remove "msg" parameter from convert_tuples_by_name
Previous Message Tom Lane 2019-09-03 23:53:05 Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?