mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
Send the lower level error directly from GetDiskID() (#10095)
this is to detect situations of corruption disk format etc errors quickly and keep the disk online in such scenarios for requests to fail appropriately.
This commit is contained in:
@@ -114,12 +114,18 @@ func (s *storageRESTServer) IsValid(w http.ResponseWriter, r *http.Request) bool
|
||||
return true
|
||||
}
|
||||
storedDiskID, err := s.storage.GetDiskID()
|
||||
if err == nil && diskID == storedDiskID {
|
||||
// If format.json is available and request sent the right disk-id, we allow the request
|
||||
return true
|
||||
if err != nil {
|
||||
s.writeErrorResponse(w, err)
|
||||
return false
|
||||
}
|
||||
s.writeErrorResponse(w, errDiskStale)
|
||||
return false
|
||||
|
||||
if diskID != storedDiskID {
|
||||
s.writeErrorResponse(w, errDiskStale)
|
||||
return false
|
||||
}
|
||||
|
||||
// If format.json is available and request sent the right disk-id, we allow the request
|
||||
return true
|
||||
}
|
||||
|
||||
// HealthHandler handler checks if disk is stale
|
||||
|
||||
Reference in New Issue
Block a user