aws / aws/aws-sdk-java-v2

The Same File Contents hashes to different ETag for encrypted buckets

Aperta
#7,082 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug service-api service:s3
Lingua principale
Java
Stelle
2.6k
Fork
1k
Merge medio
2g 9h
PR unite (30g)
51

Descrizione

### Describe the bug

As perfectly described by steveloughran in his comment [here](https://github.com/aws/aws-sdk-java-v2/issues/6785#issuecomment-4809259129), 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](https://github.com/aws/aws-sdk-java-v2/issues/6785#issuecomment-4809533876).

### 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Il report non fornisce alcun file del repository, test o punto di ingresso dell’SDK da esaminare; inizia determinando se il comportamento di ETag è controllato dal Java SDK o da bucket S3 crittografati. Riproduci i due upload descritti e conferma il risultato previsto con i maintainer prima di identificare una modifica al repository.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws
Ambito
cloud
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.