mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 18:08:29 +02:00
Use round-robin strategy while assigning workers
This commit is contained in:
@@ -30,6 +30,8 @@ type Controller struct {
|
||||
|
||||
stopCh chan struct{}
|
||||
|
||||
curWorkerID uint32 //initialized with 0
|
||||
clusterWorkers map[spec.NamespacedName]uint32
|
||||
clustersMu sync.RWMutex
|
||||
clusters map[spec.NamespacedName]*cluster.Cluster
|
||||
clusterLogs map[spec.NamespacedName]ringlog.RingLogger
|
||||
@@ -54,6 +56,7 @@ func NewController(controllerConfig *spec.ControllerConfig) *Controller {
|
||||
config: *controllerConfig,
|
||||
opConfig: &config.Config{},
|
||||
logger: logger.WithField("pkg", "controller"),
|
||||
clusterWorkers: make(map[spec.NamespacedName]uint32),
|
||||
clusters: make(map[spec.NamespacedName]*cluster.Cluster),
|
||||
clusterLogs: make(map[spec.NamespacedName]ringlog.RingLogger),
|
||||
clusterHistory: make(map[spec.NamespacedName]ringlog.RingLogger),
|
||||
|
||||
Reference in New Issue
Block a user