mirror of
https://github.com/nspcc-dev/neofs-s3-gw.git
synced 2026-03-01 04:29:15 +00:00
Non-MD5 Etag returned for objects #479
Labels
No labels
I2
I2
I3
I4
S2
S3
S4
S4
U0
U1
U2
U2
U3
U4
U4
auth-mate
blocked
bug
config
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
performance
question
security
test
tree-service
tree-service
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-s3-gw#479
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @roman-khimov on GitHub (Jan 10, 2025).
Current Behavior
Known, documented, we return SHA256 hash in Etag.
Expected Behavior
Applications expect MD5 in some cases. See https://github.com/nspcc-dev/neofs-s3-gw/pull/1030#issuecomment-2540725432
Possible Solution
Probably this can be conditional. AWS docs mention that MD5 is used in a limited number of cases and these cases can be OK for us. We can also consider calculating/storing MD5, search is pretty much the same for payload hash and some S3-specific attribute. Yeah, MD5 sucks, but who cares when we can't provide compatibility with real applications.
Steps to Reproduce
Run Nexus3 against S3 gateway.
Context
https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
Regression
No.
Your Environment
@roman-khimov commented on GitHub (Jan 10, 2025):
https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html also
@roman-khimov commented on GitHub (May 25, 2025):
The key problem is that Etag should be consistent, it's not sufficient to calculate MD5, return and forget it. The next GET should return the same Etag and request can have an Etag as well for us to compare. So it needs to be stored somewhere. But it's a hash, we can't store it in an attribute for split NeoFS objects, it needs to be a proper NeoFS-level hash then (like
nspcc-dev/neofs-api@a5a1f32630/object/types.proto (L161)) and this means NeoFS modifications. The other option is to store it in an additional object, but this obviously affects performance.