mirror of
https://github.com/minio/minio.git
synced 2024-12-25 22:55:54 -05:00
re-use globalLocalDrives properly (#18721)
This commit is contained in:
parent
8a0ba093dd
commit
5b2ced0119
@ -262,9 +262,11 @@ func (s *erasureSets) connectDisks() {
|
|||||||
s.erasureDisks[setIndex][diskIndex] = disk
|
s.erasureDisks[setIndex][diskIndex] = disk
|
||||||
s.erasureDisksMu.Unlock()
|
s.erasureDisksMu.Unlock()
|
||||||
|
|
||||||
globalLocalDrivesMu.Lock()
|
if disk.IsLocal() && globalIsDistErasure {
|
||||||
globalLocalSetDrives[s.poolIndex][setIndex][diskIndex] = disk
|
globalLocalDrivesMu.Lock()
|
||||||
globalLocalDrivesMu.Unlock()
|
globalLocalSetDrives[s.poolIndex][setIndex][diskIndex] = disk
|
||||||
|
globalLocalDrivesMu.Unlock()
|
||||||
|
}
|
||||||
}(endpoint)
|
}(endpoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,6 +405,18 @@ func newErasureSets(ctx context.Context, endpoints PoolEndpoints, storageDisks [
|
|||||||
if disk == nil {
|
if disk == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if disk.IsLocal() && globalIsDistErasure {
|
||||||
|
globalLocalDrivesMu.RLock()
|
||||||
|
ldisk := globalLocalSetDrives[poolIdx][i][j]
|
||||||
|
if ldisk == nil {
|
||||||
|
globalLocalDrivesMu.RUnlock()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
disk = ldisk
|
||||||
|
globalLocalDrivesMu.RUnlock()
|
||||||
|
}
|
||||||
|
|
||||||
innerWg.Add(1)
|
innerWg.Add(1)
|
||||||
go func(disk StorageAPI, i, j int) {
|
go func(disk StorageAPI, i, j int) {
|
||||||
defer innerWg.Done()
|
defer innerWg.Done()
|
||||||
|
Loading…
Reference in New Issue
Block a user