Postgres version: 13.5
I have 2 sets of publication/subscription between my 2 DBs. One of them is working fine and the other one is stuck at initializing state for all the tables.
sourcedb=# select * from pg_publication;
oid | pubname | pubowner | puballtables | pubinsert | pubupdate | pubdelete | pubtruncate | pubviaroot
-------+------------------------+----------+--------------+-----------+-----------+-----------+-------------+------------
19585 | omx_archive_big_tables | 16420 | f | t | t | t | t | f
19584 | omx_archive | 16420 | f | t | t | t | t | f
targetdb=# select * from pg_subscription_rel ;
srsubid | srrelid | srsubstate | srsublsn
------------+------------+------------+---------------
3615804367 | 3322052690 | i |
3615804367 | 3322052570 | i |
3615756798 | 3322051793 | r | 9E7E/BF5F82D8
3615804367 | 3322052133 | i |
3615804367 | 3322054214 | i |
3615756798 | 3322051802 | r | 9E7E/C149BBD8
3615804367 | 3322051757 | i |
targetdb=# select * from pg_subscription;
-[ RECORD 1 ]---+----------------------------------------------------------------------------------------------------------
oid | 3615756798
subdbid | 16589
subname | sub_omx_archive_big_tables_tci
subowner | 16420
subenabled | t
subconninfo | xxx
subslotname | sub_omx_archive_big_tables_tci
subsynccommit | off
subpublications | {omx_archive_big_tables}
-[ RECORD 2 ]---+----------------------------------------------------------------------------------------------------------
oid | 3615804367
subdbid | 16589
subname | sub_omx_archive_tci
subowner | 16420
subenabled | t
subconninfo | xxxx
subslotname | sub_omx_archive_tci
subsynccommit | off
subpublications | {omx_archive}
I have dropped the subscription, recreated and refreshed it many times, but it won't move from the initializing phase.
Any suggestions on how to start copying the data again, other than dropping the publication and re-creating it?
The only statement I see on the target DB log is
logical replication apply worker for subscription ""sub_omx_archive_tci"" has started",,,,,,,,,"
I don't see the logical replication table synchronization worker started for any of the tables in this subscription as I see in the other one.
Is there anything in particular that I should be looking for in the log files?
Update:
The error looks like on the subscriber side. The same publication, when subscribed to on another DB, works fine. On the subscriber side, I see 0/0
as the remote_lsn
targetdb=# select * from pg_replication_origin_status ;
local_id | external_id | remote_lsn | local_lsn
----------+---------------+----------------+----------------
1 | pg_3615756798 | 9E96/37152C80 | 1518C/9014BD98
2 | pg_3616584803 | 0/0 | 0/0
(2 rows)