forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdb08e8c

Amit Kapila
Post-commit review fixes for slot synchronization.
Allow pg_sync_replication_slots() to error out during promotion of standby.This makes the behavior of the SQL function consistent with the slot syncworker. We also ensured that pg_sync_replication_slots() cannot beexecuted if sync_replication_slots is enabled and the slotsync worker isalready running to perform the synchronization of slots. Previously, itwould have succeeded in cases when the worker is idle and failed when itis performing sync which could confuse users.This patch fixes another issue in the slot sync worker whereSignalHandlerForShutdownRequest() needs to be registered *before* settingSlotSyncCtx->pid, otherwise, the slotsync worker could miss handlingSIGINT sent by the startup process(ShutDownSlotSync) if it is sent beforeworker could register SignalHandlerForShutdownRequest(). To be consistent,all signal handlers' registration is moved to a prior location before weset the worker's pid.Ensure that we clean up synced temp slots at the end ofpg_sync_replication_slots() to avoid such slots being left over afterpromotion.Ensure that ShutDownSlotSync() captures SlotSyncCtx->pid under spinlock toavoid accessing invalid value as it can be reset by concurrent slot syncexit due to an error.Author: Shveta MalikReviewed-by: Hou Zhijie, Bertrand Drouvot, Amit Kapila, Masahiko SawadaDiscussion:https://postgr.es/m/CAJpy0uBefXUS_TSz=oxmYKHdg-fhxUT0qfjASW3nmqnzVC3p6A@mail.gmail.com1 parent0afa288 commitdb08e8c
File tree
6 files changed
+206
-98
lines changed- doc/src/sgml
- src
- backend
- replication
- logical
- tcop
- include/replication
6 files changed
+206
-98
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29349 | 29349 |
| |
29350 | 29350 |
| |
29351 | 29351 |
| |
| 29352 | + | |
| 29353 | + | |
| 29354 | + | |
| 29355 | + | |
29352 | 29356 |
| |
29353 | 29357 |
| |
29354 | 29358 |
| |
|
0 commit comments
Comments
(0)