Hash the content for fs MPU ETag if no xattr.

If there is no extended attribute support in the file system, the blobs
will not have their associated ETags available. In that case, the file
system blob store should rehash the content while producing the combined
blob and return the expected S3-style ETag.
This commit is contained in:
Timur Alperovich 2020-03-04 12:14:21 -08:00 committed by Andrew Gaul
parent f876800370
commit e66bffa521

View File

@ -840,7 +840,9 @@ public final class LocalBlobStore implements BlobStore {
Blob blobPart = getBlob(mpu.containerName(), MULTIPART_PREFIX + mpu.id() + "-" + mpu.blobName() + "-" + part.partNumber());
contentLength += blobPart.getMetadata().getContentMetadata().getContentLength();
blobs.add(blobPart);
md5Hasher.putBytes(BaseEncoding.base16().lowerCase().decode(blobPart.getMetadata().getETag()));
if (blobPart.getMetadata().getETag() != null) {
md5Hasher.putBytes(BaseEncoding.base16().lowerCase().decode(blobPart.getMetadata().getETag()));
}
}
String mpuETag = new StringBuilder("\"")
.append(md5Hasher.hash())