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:
SELECT pid
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 );
The tables that are to be resynchronized remain empty on the subscriber node.
It's due to a locking race condition when updating the subscription.