mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
add support for configurable replication MRF workers (#12125)
just like replication workers, allow failed replication workers to be configurable in situations like DR failures etc to catch up on replication sooner when DR is back online. Signed-off-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
@@ -37,8 +37,9 @@ type apiConfig struct {
|
||||
extendListLife time.Duration
|
||||
corsAllowOrigins []string
|
||||
// total drives per erasure set across pools.
|
||||
totalDriveCount int
|
||||
replicationWorkers int
|
||||
totalDriveCount int
|
||||
replicationWorkers int
|
||||
replicationFailedWorkers int
|
||||
}
|
||||
|
||||
func (t *apiConfig) init(cfg api.Config, setDriveCounts []int) {
|
||||
@@ -83,8 +84,10 @@ func (t *apiConfig) init(cfg api.Config, setDriveCounts []int) {
|
||||
t.extendListLife = cfg.ExtendListLife
|
||||
if globalReplicationPool != nil &&
|
||||
cfg.ReplicationWorkers != t.replicationWorkers {
|
||||
globalReplicationPool.Resize(cfg.ReplicationWorkers)
|
||||
globalReplicationPool.ResizeFailedWorkers(cfg.ReplicationFailedWorkers)
|
||||
globalReplicationPool.ResizeWorkers(cfg.ReplicationWorkers)
|
||||
}
|
||||
t.replicationFailedWorkers = cfg.ReplicationFailedWorkers
|
||||
t.replicationWorkers = cfg.ReplicationWorkers
|
||||
}
|
||||
|
||||
@@ -166,6 +169,13 @@ func maxClients(f http.HandlerFunc) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *apiConfig) getReplicationFailedWorkers() int {
|
||||
t.mu.RLock()
|
||||
defer t.mu.RUnlock()
|
||||
|
||||
return t.replicationFailedWorkers
|
||||
}
|
||||
|
||||
func (t *apiConfig) getReplicationWorkers() int {
|
||||
t.mu.RLock()
|
||||
defer t.mu.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user