Fix writing 'format.json' and make it atomic (#8296)

- Choose a unique uuid such that under situations of duplicate
  mounts we do not append to an existing json entry.
- Avoid AppendFile instead use WriteAll() to write the entire
  byte array atomically.
This commit is contained in:
Harshavardhana
2019-09-24 18:47:26 -07:00
committed by GitHub
parent be70ef59e7
commit c8fbc94329
3 changed files with 8 additions and 18 deletions

View File

@@ -1492,7 +1492,7 @@ func (s *xlSets) HealFormat(ctx context.Context, dryRun bool) (res madmin.HealRe
}
}
if !hasAnyErrorsUnformatted(sErrs) {
if countErrs(sErrs, errUnformattedDisk) == 0 {
// No unformatted disks found disks are either offline
// or online, no healing is required.
return res, errNoHealRequired