mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
remove SetDiskLoc() rely on the endpoint values instead (#19475)
the disk location never changes in the lifetime of a MinIO cluster, even if it did validate this close to the disk instead at the higher layer. Return appropriate errors indicating an invalid drive, so that the drive is not recognized as part of a valid drive.
This commit is contained in:
@@ -163,21 +163,11 @@ type storageRESTClient struct {
|
||||
formatMutex sync.RWMutex
|
||||
|
||||
diskInfoCache *cachevalue.Cache[DiskInfo]
|
||||
|
||||
// Indexes, will be -1 until assigned a set.
|
||||
poolIndex, setIndex, diskIndex int
|
||||
}
|
||||
|
||||
// Retrieve location indexes.
|
||||
func (client *storageRESTClient) GetDiskLoc() (poolIdx, setIdx, diskIdx int) {
|
||||
return client.poolIndex, client.setIndex, client.diskIndex
|
||||
}
|
||||
|
||||
// Set location indexes.
|
||||
func (client *storageRESTClient) SetDiskLoc(poolIdx, setIdx, diskIdx int) {
|
||||
client.poolIndex = poolIdx
|
||||
client.setIndex = setIdx
|
||||
client.diskIndex = diskIdx
|
||||
return client.endpoint.PoolIdx, client.endpoint.SetIdx, client.endpoint.DiskIdx
|
||||
}
|
||||
|
||||
// Wrapper to restClient.Call to handle network errors, in case of network error the connection is makred disconnected
|
||||
|
||||
Reference in New Issue
Block a user