mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
fs/erasure: Rename meta 'md5Sum' as 'etag'. (#4319)
This PR also does backend format change to 1.0.1 from 1.0.0. Backward compatible changes are still kept to read the 'md5Sum' key. But all new objects will be stored with the same details under 'etag'. Fixes #4312
This commit is contained in:
@@ -253,6 +253,19 @@ func readXLMetaStat(disk StorageAPI, bucket string, object string) (statInfo, ma
|
||||
if err != nil {
|
||||
return statInfo{}, nil, traceError(err)
|
||||
}
|
||||
|
||||
// obtain version.
|
||||
xlVersion := parseXLVersion(xlMetaBuf)
|
||||
|
||||
// obtain format.
|
||||
xlFormat := parseXLFormat(xlMetaBuf)
|
||||
|
||||
// Validate if the xl.json we read is sane, return corrupted format.
|
||||
if !isXLMetaValid(xlVersion, xlFormat) {
|
||||
// For version mismatchs and unrecognized format, return corrupted format.
|
||||
return statInfo{}, nil, traceError(errCorruptedFormat)
|
||||
}
|
||||
|
||||
// obtain xlMetaV1{}.Meta using `github.com/tidwall/gjson`.
|
||||
xlMetaMap := parseXLMetaMap(xlMetaBuf)
|
||||
|
||||
@@ -261,6 +274,7 @@ func readXLMetaStat(disk StorageAPI, bucket string, object string) (statInfo, ma
|
||||
if err != nil {
|
||||
return statInfo{}, nil, traceError(err)
|
||||
}
|
||||
|
||||
// Return structured `xl.json`.
|
||||
return xlStat, xlMetaMap, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user