-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ObjectStore::get_opts Incorrectly Returns Response Size not Object Size #5272
Comments
I think the correct behaviour here is what S3 is doing, if you specify a Range this will be reflected in the returned payload. S3 doesn't provide a header containing the object length, just the ContentLength of the returned payload. We should probably document this behaviour more clearly and make InMemory and any other implementations behave similarly. Thank you for the report, this is a good find |
Thanks for your response. The API could, of course, work either way. Let me add a vote to the InMemory (and, I think, File) way:
I can also, of course argue that other side, too. :-)
|
I think we are forced to follow the S3 approach, as that is all the HTTP APIs provide and we cannot perform multiple requests as this would not only be inefficient but would break atomicity.
FWIW it is actually the etag and version metadata that are important to be bundled with the response, and the motivator for returning ObjectMeta. |
The One possible wrinkle is the way that responses in the local file system are handled - in all other stores, |
Yep: storage services like s3, azblob and gcs will return the total size in |
If the full length is available to us, we should definitely return that in the metadata, that would be much less confusing. I'll have a play |
#5276 appears to pass against the emulators at least, will run some tests against the real services. Thank you all for the input 👍 |
* Fix ObjectMeta::size for range requests (#5272) * Docs * Update object_store/src/lib.rs Co-authored-by: Andrew Lamb <[email protected]> * Add tests --------- Co-authored-by: Andrew Lamb <[email protected]>
|
get_opts is documented to return the metadata of the object. When used on InMemory it does the right thing. However, when used on an S3 store, it can return the metadata of a region rather than the object.
Here is repro showing the issue:
The text was updated successfully, but these errors were encountered: