services/cos: Implement Write Returns Metadata for cos#5710
services/cos: Implement Write Returns Metadata for cos#5710Xuanwo merged 1 commit intoapache:mainfrom
Conversation
|
cc @meteorgan, would you mind taking a look at this PR? :) |
|
Hi, this PR's change seems wrong: cc @meteorgan, PRs from forks can't run our integration tests, so we need a thorough double-check here. We don't have good solutions towards this now, it's sad. |
| .cos_complete_multipart_upload(&self.path, upload_id, parts) | ||
| .await?; | ||
|
|
||
| let meta = Self::parse_metadata(resp.headers())?; |
There was a problem hiding this comment.
It looks like cos returns ETag in the CompleteMultipartUploadResult instead of header.
There was a problem hiding this comment.
According to the documentation, Etag should be included in the common response headers. However, it's missing in the examples.
There was a problem hiding this comment.
Hi, would youl like to share the docs? I failed to find it.
|
|
||
| let resp = self.core.send(req).await?; | ||
|
|
||
| let meta = Self::parse_metadata(resp.headers())?; |
There was a problem hiding this comment.
It's strange that COS doesn't claim to support append object. I couldn't find the API documentation and don't understand why we used to pass the tests.
There was a problem hiding this comment.
Seems we are using the cos's non-public API: https://github.com/tencentyun/cos-go-sdk-v5/blob/e2423bebcf86fbf162ef04cf8c46b186ff05f593/object.go#L814-L827
There was a problem hiding this comment.
So, COS didn't return an ETag for an append object (a special PutObject request), which differs from the behavior of a normal PutObject request.
There was a problem hiding this comment.
In this document, the response includes an Etag, but there is no version_id.
There was a problem hiding this comment.
It seems COS may return null as the version id when it's an appendable object.
There was a problem hiding this comment.
Yep, cos doesn't support versioning for appendable object.
|
@Ziy1-Tan are you interested to fix these issues ? it's also better to test them locally. |
Sure, Let me take a look. |

Which issue does this PR close?
Part of #5557
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?