TEST SCENARIO Purpose: To observe that the patch v14 code is now doing proper cleanups for ALTER PUBLICATION/SUBSCRIPTION. Note: The "!!>>" is extra logging added for testing, not a normal part of PG. Steps: 1. CREATE PUBLICATION for some table T1 2. CREATE SUBSCRIPTION for that publication 3. Pause the tablesync worker in CATCHUP mode (eg after created slot but before dropped that tablesyn slot) 4. Show the slots 5. ALTER PUBLICATION to DROP TABLE T1 6. ALTER SUBSCRIPTION REFRESH PUBLICATION // will discover table T1 is no longer subscribed to. // here is where the AlterSubscription should attemp to do the nececessary slot/origin cleanups 7. Show the slots 8. DROP SUBSCRIPTION // since subscription no longer knows about T1 this would not drop the tablesync slot. // So if step 6 does no T1 slot cleanup then nobody will 9. Show the slots ================== ## ## Normal PUBLICATION of a table ## [postgres@CentOS7-x64 ~]$ psql -d test_pub -c "CREATE PUBLICATION tap_pub FOR TABLE test_tab;" CREATE PUBLICATION ## ## Create subscription, and pause the tablesync in the debugger when it gets to CATCHUP state ## [postgres@CentOS7-x64 ~]$ psql -d test_sub -p 54321 -c "CREATE SUBSCRIPTION tap_sub CONNECTION 'host=localhost dbname=test_pub application_name=tap_sub' PUBLICATION tap_pub;" 2021-01-12 18:45:59.739 AEDT [7476] LOG: logical decoding found consistent point at 0/1619D30 2021-01-12 18:45:59.739 AEDT [7476] DETAIL: There are no running transactions. 2021-01-12 18:45:59.739 AEDT [7476] STATEMENT: CREATE_REPLICATION_SLOT "tap_sub" LOGICAL pgoutput NOEXPORT_SNAPSHOT NOTICE: created replication slot "tap_sub" on publisher CREATE SUBSCRIPTION 2021-01-12 18:45:59.749 AEDT [7477] LOG: logical replication apply worker for subscription "tap_sub" has started 2021-01-12 18:45:59.749 AEDT [7477] LOG: !!>> The apply worker process has PID = 7477 [postgres@CentOS7-x64 ~]$ 2021-01-12 18:45:59.756 AEDT [7483] LOG: starting logical decoding for slot "tap_sub" 2021-01-12 18:45:59.756 AEDT [7483] DETAIL: Streaming transactions committing after 0/1619D68, reading WAL from 0/1619D30. 2021-01-12 18:45:59.756 AEDT [7483] STATEMENT: START_REPLICATION SLOT "tap_sub" LOGICAL 0/0 (proto_version '2', publication_names '"tap_pub"') 2021-01-12 18:45:59.756 AEDT [7483] LOG: logical decoding found consistent point at 0/1619D30 2021-01-12 18:45:59.756 AEDT [7483] DETAIL: There are no running transactions. 2021-01-12 18:45:59.756 AEDT [7483] STATEMENT: START_REPLICATION SLOT "tap_sub" LOGICAL 0/0 (proto_version '2', publication_names '"tap_pub"') 2021-01-12 18:45:59.756 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:45:59.756 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:45:59.761 AEDT [7485] LOG: logical replication table synchronization worker for subscription "tap_sub", table "test_tab" has started 2021-01-12 18:45:59.761 AEDT [7485] LOG: !!>> The tablesync worker process has PID = 7485 2021-01-12 18:45:59.761 AEDT [7485] LOG: !!>> Sleeping 30 secs. For debugging, attach to process 7485 now! 2021-01-12 18:46:00.822 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:00.823 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:01.827 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:01.827 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:02.829 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:02.829 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:03.831 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:03.831 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:04.838 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:04.838 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:05.839 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:05.839 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:06.850 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:06.851 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:07.853 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:07.853 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:08.879 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:08.880 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:09.883 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:09.883 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:10.931 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:10.931 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:11.933 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:11.933 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:12.933 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:12.933 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:13.935 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:13.935 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:14.937 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:14.937 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:15.939 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:15.940 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:16.952 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:16.952 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:17.954 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:17.954 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:18.956 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:18.956 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:19.961 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:19.961 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:20.962 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:20.962 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:21.963 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:21.964 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:22.964 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:22.965 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:23.967 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:23.967 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:24.972 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:24.972 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:25.973 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:25.973 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:27.004 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:27.004 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:28.006 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:28.006 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:29.007 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:29.007 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:29.761 AEDT [7485] LOG: !!>> tablesync worker: About to call LogicalRepSyncTableStart to do initial syncing 2021-01-12 18:46:30.015 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:30.015 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:30.015 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:30.015 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:31.021 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:31.021 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:31.533 AEDT [7485] LOG: !!>> LogicalRepSyncTableStart: walrcv_create_slot for "pg_16399_sync_16385". 2021-01-12 18:46:31.570 AEDT [7489] LOG: logical decoding found consistent point at 0/1619D68 2021-01-12 18:46:31.570 AEDT [7489] DETAIL: There are no running transactions. 2021-01-12 18:46:31.570 AEDT [7489] STATEMENT: CREATE_REPLICATION_SLOT "pg_16399_sync_16385" LOGICAL pgoutput USE_SNAPSHOT 2021-01-12 18:46:31.576 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:31.576 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:46:31.586 AEDT [7485] LOG: !!>> LogicalRepSyncTableStart: 1 replorigin_create "pg_16399_16385". 2021-01-12 18:46:31.586 AEDT [7485] LOG: !!>> LogicalRepSyncTableStart: 1 replorigin_session_setup "pg_16399_16385". 2021-01-12 18:46:31.586 AEDT [7485] LOG: !!>> LogicalRepSyncTableStart: 1 replorigin_advance "pg_16399_16385". 2021-01-12 18:46:31.587 AEDT [7485] LOG: LogicalRepSyncTableStart: 'pg_16399_16385' origin_startpos lsn 0/1619DA0 2021-01-12 18:46:31.587 AEDT [7485] LOG: !!>> tablesync worker: wait for CATCHUP state notification 2021-01-12 18:46:31.587 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:46:31.587 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables ## ## Show the tablesync slot exists ## psql -d test_pub -c "select * from pg_replication_slots;" slot_name | plugin | slot_type | datoid | database | temporary | active | active_pid | xmin | catalog_xmin | restart_lsn | confirmed_flush_lsn | wal_status | safe_wal_size ---------------------+----------+-----------+--------+----------+-----------+--------+------------+----- -+--------------+-------------+---------------------+------------+--------------- tap_sub | pgoutput | logical | 16384 | test_pub | f | t | 7483 | | 515 | 0/1619D68 | 0/1619DA0 | reserved | pg_16399_sync_16385 | pgoutput | logical | 16384 | test_pub | f | f | | | 515 | 0/1619D68 | 0/1619DA0 | reserved | (2 rows) ## ## ALTER PUBLICATION to drop the table previously published ## [postgres@CentOS7-x64 ~]$ psql -d test_pub -c "ALTER PUBLICATION tap_pub DROP TABLE test_tab;" ALTER PUBLICATION 2021-01-12 18:47:33.644 AEDT [7483] LOG: !!>> pgoutput_begin_txn 2021-01-12 18:47:33.644 AEDT [7483] CONTEXT: slot "tap_sub", output plugin "pgoutput", in the begin callback, associated LSN 0/1619DA0 2021-01-12 18:47:33.644 AEDT [7483] STATEMENT: START_REPLICATION SLOT "tap_sub" LOGICAL 0/0 (proto_version '2', publication_names '"tap_pub"') 2021-01-12 18:47:33.644 AEDT [7483] LOG: !!>> pgoutput_commit_txn 2021-01-12 18:47:33.644 AEDT [7483] CONTEXT: slot "tap_sub", output plugin "pgoutput", in the commit callback, associated LSN 0/1619F68 2021-01-12 18:47:33.644 AEDT [7483] STATEMENT: START_REPLICATION SLOT "tap_sub" LOGICAL 0/0 (proto_version '2', publication_names '"tap_pub"') [postgres@CentOS7-x64 ~]$ ## ## ALTER SUBSCRIPTION to REFRESH the publication ## [postgres@CentOS7-x64 ~]$ psql -d test_sub -p 54321 -c "ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION;" ## ## Below the AlterSubscription_refresh kills the tablesync worker (PID 31097) ## 2021-01-12 18:48:22.438 AEDT [7532] LOG: !!>> AlterSubscription_refresh: before logicalrep_worker_stop 2021-01-12 18:48:22.438 AEDT [7532] STATEMENT: ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION; 2021-01-12 18:48:49.432 AEDT [7485] LOG: !!>> tablesync worker: received CATCHUP state notification 2021-01-12 18:48:49.432 AEDT [7485] FATAL: terminating logical replication worker due to administrator command 2021-01-12 18:48:49.433 AEDT [7135] LOG: background worker "logical replication worker" (PID 7485) exited with exit code 1 2021-01-12 18:48:49.433 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:49.433 AEDT [7477] LOG: !!>> apply worker: apply_dispatch for message kind 'B' 2021-01-12 18:48:49.434 AEDT [7477] LOG: !!>> apply worker: apply_dispatch for message kind 'C' 2021-01-12 18:48:49.434 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:49.439 AEDT [7532] LOG: !!>> AlterSubscription_refresh: after logicalrep_worker_stop 2021-01-12 18:48:49.439 AEDT [7532] STATEMENT: ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION; ## ## The killed tablesync has FINISHEDCOPY ('f') state mode when it was killed, so the AlterSubscription_refresh ## will try to drop the tablesync slot. ## ## Note, in this case the slot existed so it is drops successfully. ## 2021-01-12 18:48:49.439 AEDT [7532] LOG: !!>> AlterSubscription_refresh: relid 16385 had state f 2021-01-12 18:48:49.439 AEDT [7532] STATEMENT: ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION; 2021-01-12 18:48:49.439 AEDT [7532] LOG: AlterSubscription_refresh: dropping the tablesync slot "pg_16399_sync_16385". 2021-01-12 18:48:49.439 AEDT [7532] STATEMENT: ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION; 2021-01-12 18:48:49.442 AEDT [7532] LOG: !!>> AlterSubscription_refresh: dropped the tablesync slot "pg_16399_sync_16385". 2021-01-12 18:48:49.442 AEDT [7532] STATEMENT: ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION; 2021-01-12 18:48:49.442 AEDT [7532] LOG: AlterSubscription_refresh: dropping origin tracking for "pg_16399_16385" 2021-01-12 18:48:49.442 AEDT [7532] STATEMENT: ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION; 2021-01-12 18:48:49.442 AEDT [7532] LOG: !!>> AlterSubscription_refresh: dropped origin tracking for "pg_16399_16385" 2021-01-12 18:48:49.442 AEDT [7532] STATEMENT: ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION; 2021-01-12 18:48:49.442 AEDT [7532] LOG: table "public.test_tab" removed from subscription "tap_sub" 2021-01-12 18:48:49.442 AEDT [7532] STATEMENT: ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION; NOTICE: dropped replication slot "pg_16399_sync_16385" on publisher 2021-01-12 18:48:49.444 AEDT [7544] FATAL: terminating logical replication worker due to administrator command ## ## Apply working continues... ## 2021-01-12 18:48:49.444 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:49.445 AEDT [7135] LOG: background worker "logical replication worker" (PID 7544) exited with exit code 1 2021-01-12 18:48:49.445 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:49.445 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables ALTER SUBSCRIPTION [postgres@CentOS7-x64 ~]$ 2021-01-12 18:48:50.447 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:50.447 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:51.469 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:51.469 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:52.481 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:52.481 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:53.483 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:53.483 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:54.485 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:54.485 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:55.486 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:55.486 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:56.486 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:56.486 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:57.489 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:57.489 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:58.490 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:58.490 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:48:59.491 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:48:59.491 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:00.493 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:00.493 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:01.496 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:01.496 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables ## ## show slot shows that the AlterSubscription did drop the tablesync slot ok ## psql -d test_pub -c "select * from pg_replication_slots;" slot_name | plugin | slot_type | datoid | database | temporary | active | active_pid | xmin | catalog _xmin | restart_lsn | confirmed_flush_lsn | wal_status | safe_wal_size -----------+----------+-----------+--------+----------+-----------+--------+------------+------+-------- ------+-------------+---------------------+------------+--------------- tap_sub | pgoutput | logical | 16384 | test_pub | f | t | 7483 | | 516 | 0/1619FE0 | 0/161A118 | reserved | (1 row) [postgres@CentOS7-x64 ~]$ 2021-01-12 18:49:03.503 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:03.503 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:04.505 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:04.505 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:05.542 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:05.542 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:06.549 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:06.549 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:07.550 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:07.550 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:08.560 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:08.560 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:09.573 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:09.573 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:10.589 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:10.589 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:11.590 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:11.590 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:12.591 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:12.592 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables ## ## Drop the whole subscription. Main slot is dropped. ## psql -d test_sub -p 54321 -c "DROP SUBSCRIPTION tap_sub;" 2021-01-12 18:49:13.593 AEDT [7477] LOG: !!>> apply worker: LogicalRepApplyLoop 2021-01-12 18:49:13.593 AEDT [7477] LOG: !!>> apply worker: called process_syncing_tables 2021-01-12 18:49:14.308 AEDT [7477] FATAL: terminating logical replication worker due to administrator command 2021-01-12 18:49:14.309 AEDT [7135] LOG: background worker "logical replication worker" (PID 7477) exited with exit code 1 NOTICE: dropped replication slot "tap_sub" on publisher DROP SUBSCRIPTION [postgres@CentOS7-x64 ~]$ [postgres@CentOS7-x64 ~]$ psql -d test_pub -c "select * from pg_replication_slots;" slot_name | plugin | slot_type | datoid | database | temporary | active | active_pid | xmin | catalog_x min | restart_lsn | confirmed_flush_lsn | wal_status | safe_wal_size -----------+--------+-----------+--------+----------+-----------+--------+------------+------+---------- ----+-------------+---------------------+------------+--------------- (0 rows) [END]