Skip to content

Comments

services/cos: Implement Write Returns Metadata for cos#5710

Merged
Xuanwo merged 1 commit intoapache:mainfrom
Ziy1-Tan:md-cos
Mar 8, 2025
Merged

services/cos: Implement Write Returns Metadata for cos#5710
Xuanwo merged 1 commit intoapache:mainfrom
Ziy1-Tan:md-cos

Conversation

@Ziy1-Tan
Copy link
Contributor

@Ziy1-Tan Ziy1-Tan commented Mar 8, 2025

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?

@Ziy1-Tan Ziy1-Tan requested a review from Xuanwo as a code owner March 8, 2025 08:53
@Ziy1-Tan
Copy link
Contributor Author

Ziy1-Tan commented Mar 8, 2025

cc @meteorgan, would you mind taking a look at this PR? :)

Copy link
Contributor

@meteorgan meteorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for this @Ziy1-Tan

@Xuanwo Xuanwo merged commit 5194625 into apache:main Mar 8, 2025
93 checks passed
@Xuanwo
Copy link
Member

Xuanwo commented Mar 8, 2025

Hi, this PR's change seems wrong:

failures:

---- behavior::test_writer_return_metadata ----
test panicked: assertion `left == right` failed
  left: Some("\"a232d2c3a470308f9de0ce67a4574f7b-2\"")
 right: None

---- behavior::test_write_with_append_returns_metadata ----
test panicked: assertion `left == right` failed
  left: Some("null")
 right: None

---- behavior::test_blocking_write_with_append_returns_metadata ----
test panicked: assertion `left == right` failed
  left: None
 right: Some("null")


failures:
    behavior::test_writer_return_metadata
    behavior::test_write_with_append_returns_metadata
    behavior::test_blocking_write_with_append_returns_metadata

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())?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like cos returns ETag in the CompleteMultipartUploadResult instead of header.

https://cloud.tencent.com/document/product/436/7742

Copy link
Contributor

@meteorgan meteorgan Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the documentation, Etag should be included in the common response headers. However, it's missing in the examples.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, would youl like to share the docs? I failed to find it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the docs you referenced ealier.
image


let resp = self.core.send(req).await?;

let meta = Self::parse_metadata(resp.headers())?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@meteorgan meteorgan Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this document, the response includes an Etag, but there is no version_id.

Copy link
Contributor

@meteorgan meteorgan Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems COS may return null as the version id when it's an appendable object.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, cos doesn't support versioning for appendable object.

Xuanwo added a commit that referenced this pull request Mar 8, 2025
Xuanwo added a commit that referenced this pull request Mar 8, 2025
#5713)

Revert "services/cos: Implement Write Returns Metadata for cos (#5710)"

This reverts commit 5194625.
@meteorgan
Copy link
Contributor

@Ziy1-Tan are you interested to fix these issues ? it's also better to test them locally.

@Ziy1-Tan
Copy link
Contributor Author

@Ziy1-Tan are you interested to fix these issues ? it's also better to test them locally.

Sure, Let me take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants