pglogical does not resynchronize table

Mark Wong
Mark Wong


After calling the function pglogical.alter_subscription_resynchronize_table() to resynchronize a table, the table remains empty.


This is a bug with pglogical that will be fixed as of v2.2.

Prior to v2.2, the workaround is to kill the pglogical apply process on the subscriber. The pglogical apply process will restart after a few seconds and launch the sync command again. This will be represented on the provider as COPY commands on the provider node.

One way to identify the pglogical apply is to query the pg_stat_activity table:

FROM pg_stat_activity
WHERE application_name LIKE 'pglogical apply%';

Then the backend process can be terminated with the following SQL command:

SELECT pg_terminate_backend( PID_FROM_ABOVE );

Diagnostic Steps

The tables that are to be resynchronized remain empty on the subscriber node.

Root Cause

It's due to a locking race condition when updating the subscription.

Was this article helpful?

0 out of 0 found this helpful