Drop replication origin slots before tablesync worker exits.
Amit Kapila <akapila@postgresql.org>
Drop replication origin slots before tablesync worker exits. Currently, the replication origin tracking of the tablesync worker is dropped by the apply worker. So, there will be a small lag between the tablesync worker exit and its origin tracking got removed. In the meantime, new tablesync workers can be launched and will try to set up a new origin tracking. This can lead the system to reach max configured limit (max_replication_slots) even if the user has configured the max limit considering the number of tablesync workers required in the system. We decided not to back-patch as this can occur in very narrow circumstances and users have to option to increase the configured limit by increasing max_replication_slots. Reported-by: Hubert Depesz Lubaczewski Author: Ajin Cherian Reviwed-by: Masahiko Sawada, Peter Smith, Hou Zhijie, Amit Kapila Discussion: https://postgr.es/m/20220714115155.GA5439@depesz.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/subscriptioncmds.c | modified | +14 −11 |
| src/backend/replication/logical/tablesync.c | modified | +27 −23 |
Discussion
- Excessive number of replication slots for 12->14 logical replication 61 messages · 2022-07-14 → 2024-01-22