mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 06:25:20 +02:00
use uint64 for replication lag from Patroni's member endpoint (#1893)
* use int64 for replication lag from Patroni's member endpoint
This commit is contained in:
+2
-2
@@ -522,13 +522,13 @@ func (c *Cluster) getSwitchoverCandidate(master *v1.Pod) (spec.NamespacedName, e
|
||||
// if sync_standby replicas were found assume synchronous_mode is enabled and ignore other candidates list
|
||||
if len(syncCandidates) > 0 {
|
||||
sort.Slice(syncCandidates, func(i, j int) bool {
|
||||
return util.IntFromIntStr(syncCandidates[i].Lag) < util.IntFromIntStr(syncCandidates[j].Lag)
|
||||
return syncCandidates[i].Lag < syncCandidates[j].Lag
|
||||
})
|
||||
return spec.NamespacedName{Namespace: master.Namespace, Name: syncCandidates[0].Name}, nil
|
||||
}
|
||||
if len(candidates) > 0 {
|
||||
sort.Slice(candidates, func(i, j int) bool {
|
||||
return util.IntFromIntStr(candidates[i].Lag) < util.IntFromIntStr(candidates[j].Lag)
|
||||
return candidates[i].Lag < candidates[j].Lag
|
||||
})
|
||||
return spec.NamespacedName{Namespace: master.Namespace, Name: candidates[0].Name}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user