Skip to content

Commit 696f707

Browse files
⏺ fix(drain): reload pg config after sync standby removal
During scale-down, the operator removes draining standbys from synchronous_standby_names via UpdateSynchronousStandbyList but omits ReloadConfig, so ALTER SYSTEM SET writes to postgresql.auto.conf without calling pg_reload_conf(). The runtime config stays stale, causing a write stall when all standbys disconnect. - Set ReloadConfig: true on REMOVE request in drain.go DrainStateRequested path - Set ReloadConfig: true on REMOVE request in drain.go DrainStateDraining verification path Prevents sync replication write stall during scale-down by ensuring runtime config reflects each standby removal.
1 parent 63ec977 commit 696f707

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/data-handler/drain/drain.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ func ExecuteDrainStateMachine(
156156
return true, nil
157157
} else {
158158
req := &multipoolermanagerdatapb.UpdateSynchronousStandbyListRequest{
159-
Operation: multipoolermanagerdatapb.StandbyUpdateOperation_STANDBY_UPDATE_OPERATION_REMOVE,
160-
StandbyIds: []*clustermetadatapb.ID{myPooler.Id},
159+
Operation: multipoolermanagerdatapb.StandbyUpdateOperation_STANDBY_UPDATE_OPERATION_REMOVE,
160+
StandbyIds: []*clustermetadatapb.ID{myPooler.Id},
161+
ReloadConfig: true,
161162
}
162163
_, rpcErr := rpcClient.UpdateSynchronousStandbyList(ctx, primary, req)
163164
if rpcErr != nil {
@@ -203,8 +204,9 @@ func ExecuteDrainStateMachine(
203204
return true, nil
204205
} else {
205206
req := &multipoolermanagerdatapb.UpdateSynchronousStandbyListRequest{
206-
Operation: multipoolermanagerdatapb.StandbyUpdateOperation_STANDBY_UPDATE_OPERATION_REMOVE,
207-
StandbyIds: []*clustermetadatapb.ID{myPooler.Id},
207+
Operation: multipoolermanagerdatapb.StandbyUpdateOperation_STANDBY_UPDATE_OPERATION_REMOVE,
208+
StandbyIds: []*clustermetadatapb.ID{myPooler.Id},
209+
ReloadConfig: true,
208210
}
209211
_, rpcErr := rpcClient.UpdateSynchronousStandbyList(ctx, primary, req)
210212
if rpcErr != nil {

0 commit comments

Comments
 (0)