mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
reject reference format from a different deployment (#18800)
reference format is constant for any lifetime of a minio cluster, we do not have to ever replace it during HealFormat() as it will never change. additionally we should simply reject reference formats that we do not understand early on.
This commit is contained in:
parent
8ccd1ee34a
commit
a0e1163fb6
@ -1111,6 +1111,13 @@ func (s *erasureSets) HealFormat(ctx context.Context, dryRun bool) (res madmin.H
|
||||
return res, errNoHealRequired
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(s.format, refFormat) {
|
||||
// Format is corrupted and unrecognized by the running instance.
|
||||
logger.LogIf(ctx, fmt.Errorf("Unable to heal the newly replaced drives due to format.json inconsistencies, please engage MinIO support for further assistance: %w",
|
||||
errCorruptedFormat))
|
||||
return res, errCorruptedFormat
|
||||
}
|
||||
|
||||
formatOpID := mustGetUUID()
|
||||
|
||||
// Initialize a new set of set formats which will be written to disk.
|
||||
@ -1192,9 +1199,6 @@ func (s *erasureSets) HealFormat(ctx context.Context, dryRun bool) (res madmin.H
|
||||
}
|
||||
}
|
||||
|
||||
// Replace reference format with what was loaded from disks.
|
||||
s.format = refFormat
|
||||
|
||||
s.erasureDisksMu.Unlock()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user