mirror of https://github.com/minio/minio.git
docs/debug: log any corruption and continue debug tool
This commit is contained in:
parent
de400f3473
commit
109c927dad
|
@ -121,11 +121,12 @@ func main() {
|
|||
if p, err := strconv.Atoi(s[1]); err == nil {
|
||||
parts = p
|
||||
} else {
|
||||
log.Fatalln("ETAG: wrong format:", err)
|
||||
log.Println("ETAG: wrong format:", err)
|
||||
continue
|
||||
}
|
||||
default:
|
||||
log.Fatalln("Unexpected ETAG format", object.ETag)
|
||||
log.Println("Unexpected ETAG format", object.ETag)
|
||||
continue
|
||||
}
|
||||
|
||||
var partsMD5Sum [][]byte
|
||||
|
@ -134,12 +135,12 @@ func main() {
|
|||
obj, err := s3Client.GetObject(context.Background(), bucket, object.Key,
|
||||
minio.GetObjectOptions{VersionID: object.VersionID, PartNumber: p})
|
||||
if err != nil {
|
||||
log.Fatalln("GET", bucket, object.Key, object.VersionID, "=>", err)
|
||||
log.Println("GET", bucket, object.Key, object.VersionID, "=>", err)
|
||||
continue
|
||||
}
|
||||
h := md5.New()
|
||||
if _, err := io.Copy(h, obj); err != nil {
|
||||
log.Fatalln("MD5 calculation error:", bucket, object.Key, object.VersionID, "=>", err)
|
||||
log.Println("MD5 calculation error:", bucket, object.Key, object.VersionID, "=>", err)
|
||||
continue
|
||||
}
|
||||
partsMD5Sum = append(partsMD5Sum, h.Sum(nil))
|
||||
|
@ -165,10 +166,10 @@ func main() {
|
|||
}
|
||||
|
||||
if corrupted {
|
||||
log.Fatalln("CORRUPTED object:", bucket, object.Key, object.VersionID)
|
||||
}
|
||||
|
||||
log.Println("CORRUPTED object:", bucket, object.Key, object.VersionID)
|
||||
} else {
|
||||
log.Println("INTACT", bucket, object.Key, object.VersionID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue