skip disks under scanning when healing disks (#17822)

Bonus:

- avoid calling DiskInfo() calls when missing blocks
  instead heal the object using MRF operation.

- change the max_sleep to 250ms beyond that we will
  not stop healing.
This commit is contained in:
Harshavardhana
2023-08-09 12:51:47 -07:00
committed by GitHub
parent 6e860b6dc5
commit c45bc32d98
6 changed files with 42 additions and 22 deletions

View File

@@ -192,7 +192,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
tracker.setObject("")
tracker.setBucket(bucket)
// Heal current bucket again in case if it is failed
// in the being of erasure set healing
// in the beginning of erasure set healing
if _, err := er.HealBucket(ctx, bucket, madmin.HealOpts{
ScanMode: scanMode,
}); err != nil {
@@ -241,7 +241,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
}
// Collect updates to tracker from concurrent healEntry calls
results := make(chan healEntryResult)
results := make(chan healEntryResult, 1000)
go func() {
for res := range results {
if res.entryDone {
@@ -256,6 +256,15 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
}
}()
send := func(result healEntryResult) bool {
select {
case <-ctx.Done():
return false
case results <- result:
return true
}
}
// Note: updates from healEntry to tracker must be sent on results channel.
healEntry := func(bucket string, entry metaCacheEntry) {
if entry.name == "" && len(entry.metadata) == 0 {
@@ -302,12 +311,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
result = healEntrySuccess(0)
}
select {
case <-ctx.Done():
return
case results <- result:
}
send(result)
return
}
@@ -342,10 +346,8 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
}
bgSeq.logHeal(madmin.HealItemObject)
select {
case <-ctx.Done():
if !send(result) {
return
case results <- result:
}
}
// All versions resulted in 'ObjectNotFound'