Skip to content

The Same File Contents hashes to different ETag for encrypted buckets #7082

Description

@decoursin

Describe the bug

As perfectly described by steveloughran in his comment here, single file uploads hash to completely different etags in encrypted buckets even when the file contents are exactly the same.

Since the dawn of S3 (correct?), etags have consistently identified the contents of the same file. This means that as long as the file is the same -- doesn't change -- the file will always have the same etag; and this is completely independent of whether the file is downloaded and then reuploaded to a different path.

However, encrypted buckets have changed this formula, so that the same file uploaded to different paths no longer has the same etag. This is contrary to the definition and purpose of Etags, as I explained here.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

When using Encrypted Buckets, just like in Decrypted Buckets, the same file should have the same Etag regardless of whether it's re-uploaded to a different path or not.

Current Behavior

Already explained above.

Reproduction Steps

Go to S3 Console, create an encrypted bucket, take a file, upload it to one path, then upload the same file to a different path. Compare the resulting ETags and notice that they're different (even though they're supposed to be the exact same).

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

Any

JDK version used

Any

Operating System and version

Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions