Handle part_number in HeadObject and GetObject (#191) #192
No reviewers
Labels
No labels
action
check-aws
action
discussion-needed
action
for-external-contributors
action
for-newcomers
action
more-info-needed
action
need-funding
action
triage-required
kind
correctness
kind
ideas
kind
improvement
kind
performance
kind
testing
kind
usability
kind
wrong-behavior
prio
critical
prio
low
scope
admin-api
scope
background-healing
scope
build
scope
documentation
scope
k8s
scope
layout
scope
metadata
scope
ops
scope
rpc
scope
s3-api
scope
security
scope
telemetry
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#192
Loading…
Reference in a new issue
No description provided.
Delete branch "get-head-part-number"
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?
0110ae5f1f
tof23b61a7f3
@ -55,2 +55,4 @@
BucketNotEmpty,
/// Parts specified in CMU request do not match parts actually uploaded
#[error(display = "Parts given to CompleteMultipartUpload do not match uploade dparts")]
typo
@ -121,0 +123,4 @@
if let ObjectVersionData::Inline(_, _) = version_data {
// Not a multipart upload
return Err(Error::BadRequest(
"Cannt process part_number argument: not a multipart upload".into(),
typo
@ -446,0 +454,4 @@
.iter()
.zip(body_list_of_parts.iter().skip(1))
.all(|(p1, p2)| p1.part_number + 1 == p2.part_number)
{
to verify, but I think this is stricter than AWS : I believe I've read somewhere it's possible to have holes between part number, so
2, 4, 6
would be a correct sequence. Will try against AWS when I have timeI can confirm AWS accept providing the part number list
2, 4
, so it neither require starting from 1, nor be sequential, only ordered and between 1 and 10000f23b61a7f3
to3c5945a585
3c5945a585
to26a7309839
26a7309839
to43c27eef9b
43c27eef9b
to0c7834bfa7
0c7834bfa7
to338b1b83ee
multiple small diffences with AWS. I wouldn't consider them blocking, if you want to merge this quiclky, just open an issue for them.
Overall, lgtm
@ -121,0 +123,4 @@
if let ObjectVersionData::Inline(_, _) = version_data {
// Not a multipart upload
return Err(Error::BadRequest(
"Cannot process part_number argument: not a multipart upload".into(),
minor missmatch with AWS : if not multipart, AWS consider everything is contained in part 1.
@ -121,0 +151,4 @@
Ok(object_headers(object_version, version_meta)
.header(CONTENT_LENGTH, format!("{}", part_size))
.header("x-amz-mp-parts-count", format!("{}", n_parts))
.status(StatusCode::OK)
AWS returns byte range headers and HTTP 206 (Partial Content) as if it was a range request
@ -316,0 +319,4 @@
.ok_or(Error::NoSuchKey)?
} else {
return Err(Error::BadRequest(
"Cannot handle part_number: not a multipart upload.".into(),
Same as above
@ -316,0 +337,4 @@
let part_size = blocks.iter().map(|(_, b)| b.size).sum();
if let Some(r) = parse_range_header(req, part_size)? {
AWS does not support this kind of request (InvalidRequest: Cannot specify both Range header and partNumber query parameter).
I'm not sure if we should support it, S3 libraries won't ever call that, and it's additional code to maitain. On the other hand, it's not a lot of code, so this message is purely informative, and not necessary requiring any changes
@ -316,0 +355,4 @@
Ok(object_headers(object_version, version_meta)
.header(CONTENT_LENGTH, format!("{}", part_size))
.status(StatusCode::OK)
Same as above