mirror of
https://github.com/pgsty/minio.git
synced 2026-10-07 18:25:58 +03:00
Streaming bitrot verification support (#7004)
This commit is contained in:
committed by
Harshavardhana
parent
94c52e3816
commit
98c950aacd
+18
-1
@@ -58,7 +58,7 @@ type ChecksumInfo struct {
|
||||
type checksumInfoJSON struct {
|
||||
Name string `json:"name"`
|
||||
Algorithm string `json:"algorithm"`
|
||||
Hash string `json:"hash"`
|
||||
Hash string `json:"hash,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON marshals the ChecksumInfo struct
|
||||
@@ -186,6 +186,23 @@ func newXLMetaV1(object string, dataBlocks, parityBlocks int) (xlMeta xlMetaV1)
|
||||
return xlMeta
|
||||
}
|
||||
|
||||
// Return a new xlMetaV1 initialized using the given xlMetaV1. Used in healing to make sure that we do not copy
|
||||
// over any part's checksum info which will differ for different disks.
|
||||
func newXLMetaFromXLMeta(meta xlMetaV1) xlMetaV1 {
|
||||
xlMeta := xlMetaV1{}
|
||||
xlMeta.Version = xlMetaVersion
|
||||
xlMeta.Format = xlMetaFormat
|
||||
xlMeta.Minio.Release = ReleaseTag
|
||||
xlMeta.Erasure = ErasureInfo{
|
||||
Algorithm: meta.Erasure.Algorithm,
|
||||
DataBlocks: meta.Erasure.DataBlocks,
|
||||
ParityBlocks: meta.Erasure.DataBlocks,
|
||||
BlockSize: meta.Erasure.BlockSize,
|
||||
Distribution: meta.Erasure.Distribution,
|
||||
}
|
||||
return xlMeta
|
||||
}
|
||||
|
||||
// IsValid - tells if the format is sane by validating the version
|
||||
// string, format and erasure info fields.
|
||||
func (m xlMetaV1) IsValid() bool {
|
||||
|
||||
Reference in New Issue
Block a user