From 8295e2feb680f383d1d28c51052168fe549ef375 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 6 Jun 2021 22:16:32 -0700 Subject: [PATCH] skip md5 checking for now because of race condition --- weed/server/filer_server_handlers_write_upload.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/weed/server/filer_server_handlers_write_upload.go b/weed/server/filer_server_handlers_write_upload.go index cc351d718..cc9bb0dc0 100644 --- a/weed/server/filer_server_handlers_write_upload.go +++ b/weed/server/filer_server_handlers_write_upload.go @@ -67,7 +67,7 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque go func(offset int64) { defer wg.Done() - chunk, toChunkErr := fs.dataToChunk(fileName, contentType, bytesBuffer.Bytes(), offset, so, md5Hash) + chunk, toChunkErr := fs.dataToChunk(fileName, contentType, bytesBuffer.Bytes(), offset, so) if toChunkErr != nil { uploadErr = toChunkErr } @@ -114,7 +114,7 @@ func (fs *FilerServer) doUpload(urlLocation string, limitedReader io.Reader, fil return uploadResult, err, data } -func (fs *FilerServer) dataToChunk(fileName, contentType string, data []byte, chunkOffset int64, so *operation.StorageOption, md5Hash hash.Hash) (*filer_pb.FileChunk, error) { +func (fs *FilerServer) dataToChunk(fileName, contentType string, data []byte, chunkOffset int64, so *operation.StorageOption) (*filer_pb.FileChunk, error) { dataReader := util.NewBytesReader(data) // retry to assign a different file id @@ -149,13 +149,6 @@ func (fs *FilerServer) dataToChunk(fileName, contentType string, data []byte, ch if uploadResult.Size == 0 { return nil, nil } - if chunkOffset == 0 { - uploadedMd5 := util.Base64Md5ToBytes(uploadResult.ContentMd5) - readedMd5 := md5Hash.Sum(nil) - if !bytes.Equal(uploadedMd5, readedMd5) { - glog.Errorf("md5 %x does not match %x uploaded chunk %s to the volume server", readedMd5, uploadedMd5, uploadResult.Name) - } - } return uploadResult.ToPbFileChunk(fileId, chunkOffset), nil }