forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8edacab
committed
Fix DROP SUBSCRIPTION hang
When ALTER SUBSCRIPTION DISABLE is run in the same transaction beforeDROP SUBSCRIPTION, the latter will hang because workers will still berunning, not having seen the DISABLE committed, and DROP SUBSCRIPTIONwill wait until the workers have vacated the replication origin slots.Previously, DROP SUBSCRIPTION killed the logical replication workersimmediately only if it was going to drop the replication slot, otherwiseit scheduled the worker killing for the end of the transaction, as aresult of7e174fa. This, however,causes the present problem. To fix, kill the workers immediately in allcases. This covers all cases: A subscription that doesn't have areplication slot must be disabled. It was either disabled in the sametransaction, or it was already disabled before the current transaction,but then there shouldn't be any workers left and this won't make adifference.Reported-by: Arseny Sher <a.sher@postgrespro.ru>Discussion:https://www.postgresql.org/message-id/flat/87mv6av84w.fsf%40ars-thinkpad1 parent68ab9ac commit8edacab
File tree
2 files changed
+63
-7
lines changed- src
- backend/commands
- test/subscription/t
2 files changed
+63
-7
lines changedLines changed: 12 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
909 | 909 |
| |
910 | 910 |
| |
911 | 911 |
| |
912 |
| - | |
913 |
| - | |
914 |
| - | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
915 | 923 |
| |
916 | 924 |
| |
917 | 925 |
| |
| |||
923 | 931 |
| |
924 | 932 |
| |
925 | 933 |
| |
926 |
| - | |
927 |
| - | |
928 |
| - | |
929 |
| - | |
| 934 | + | |
930 | 935 |
| |
931 | 936 |
| |
932 | 937 |
| |
|
Lines changed: 51 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + |
0 commit comments
Comments
(0)