You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keeper new flags:
--can-be-master, prevent keeper from being elected as master
--can-be-synchronous-replica, prevent keeper from being chosen as
synchronous replica
Updates sentinel to support keepers with new flags:
- findBestNewMasters: ignoring keepers that cannot become master
- updateKeeperStatus: update `KeeperStatus` to have `NeverMaster` and
`NeverSynchronousReplica` properties
- updateCluster: ignore standbys that cannot be synchronous standbys
Copy file name to clipboardExpand all lines: cmd/keeper/cmd/keeper.go
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,9 @@ type config struct {
112
112
pgSUUsernamestring
113
113
pgSUPasswordstring
114
114
pgSUPasswordFilestring
115
+
116
+
canBeMasterbool
117
+
canBeSynchronousReplicabool
115
118
}
116
119
117
120
varcfgconfig
@@ -137,6 +140,9 @@ func init() {
137
140
CmdKeeper.PersistentFlags().StringVar(&cfg.pgSUPasswordFile, "pg-su-passwordfile", "", "postgres superuser password file. Only one of --pg-su-password or --pg-su-passwordfile must be provided. Must be the same for all keepers)")
CmdKeeper.PersistentFlags().BoolVar(&cfg.canBeMaster, "can-be-master", true, "prevent keeper from being elected as master")
144
+
CmdKeeper.PersistentFlags().BoolVar(&cfg.canBeSynchronousReplica, "can-be-synchronous-replica", true, "prevent keeper from being chosen as synchronous replica")
145
+
140
146
iferr:=CmdKeeper.PersistentFlags().MarkDeprecated("id", "please use --uid"); err!=nil {
log.Debugw("ignoring keeper since its pg timeline is different than master timeline", "db", db.UID, "dbTimeline", db.Status.TimelineID, "masterTimeline", masterDB.Status.TimelineID)
735
759
continue
736
760
}
761
+
737
762
// do this only when not using synchronous replication since in sync repl we
738
763
// have to ignore the last reported xlogpos or valid sync standby will be
log.Infow("cannot choose standby as synchronous (--can-be-synchronous-replica=false)", "db", db.UID, "keeper", keeper.UID)
1337
+
continue
1338
+
}
1339
+
}
1340
+
1305
1341
log.Infow("adding new synchronous standby in good state trying to reach MaxSynchronousStandbys", "masterDB", masterDB.UID, "synchronousStandbyDB", bestStandby.UID, "keeper", bestStandby.Spec.KeeperUID)
0 commit comments