mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
heal: calculate the number of workers based on NRRequests (#17945)
This commit is contained in:
@@ -114,6 +114,8 @@ type xlStorage struct {
|
||||
|
||||
formatData []byte
|
||||
|
||||
nrRequests uint64
|
||||
|
||||
// mutex to prevent concurrent read operations overloading walks.
|
||||
rotational bool
|
||||
walkMu *sync.Mutex
|
||||
@@ -244,6 +246,11 @@ func newXLStorage(ep Endpoint, cleanUp bool) (s *xlStorage, err error) {
|
||||
diskIndex: -1,
|
||||
}
|
||||
|
||||
// Sanitize before setting it
|
||||
if info.NRRequests > 0 {
|
||||
s.nrRequests = info.NRRequests
|
||||
}
|
||||
|
||||
// We stagger listings only on HDDs.
|
||||
if info.Rotational == nil || *info.Rotational {
|
||||
s.rotational = true
|
||||
@@ -658,6 +665,7 @@ func (s *xlStorage) DiskInfo(_ context.Context, _ bool) (info DiskInfo, err erro
|
||||
dcinfo.UsedInodes = di.Files - di.Ffree
|
||||
dcinfo.FreeInodes = di.Ffree
|
||||
dcinfo.FSType = di.FSType
|
||||
dcinfo.NRRequests = s.nrRequests
|
||||
dcinfo.Rotational = s.rotational
|
||||
diskID, err := s.GetDiskID()
|
||||
// Healing is 'true' when
|
||||
|
||||
Reference in New Issue
Block a user