File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
internal/controller/postgrescluster Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -648,6 +648,17 @@ func (r *Reconciler) reconcilePGBouncerReconnect(
648648 return nil
649649 }
650650
651+ if lastFailoverUID == "" {
652+ // First time seeing this cluster or status field was just added.
653+ // Initialize with current primary UID without triggering pod restart.
654+ log .V (1 ).Info ("Initializing PgBouncer failover tracking" ,
655+ "currentPrimaryUID" , currentPrimaryUID ,
656+ "currentPrimaryName" , primaryPod .Name )
657+
658+ cluster .Status .Proxy .PGBouncer .LastFailoverPrimaryUID = currentPrimaryUID
659+ return nil
660+ }
661+
651662 log .Info ("Primary changed, triggering PgBouncer failover signal (SIGTERM)" ,
652663 "previousPrimaryUID" , lastFailoverUID ,
653664 "currentPrimaryUID" , currentPrimaryUID ,
You can’t perform that action at this time.
0 commit comments