Skip to content
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

chore(sink): validate file sink when creating #18707

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

wcy-fdu
Copy link
Contributor

@wcy-fdu wcy-fdu commented Sep 25, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

as title, otherwise it will not raise error as we enable sink decouple.
close #18228

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@wcy-fdu wcy-fdu requested a review from lmatz September 25, 2024 08:50
Copy link
Contributor

@lmatz lmatz left a comment

Choose a reason for hiding this comment

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

lgtm, possible to add an e2e test case?

Comment on lines 114 to 118
match self.op.list(&self.path).await {
Ok(_) => Ok(()),
Err(e) => Err(anyhow!(e)
.context("Fail to create sink, please check your config.")
.into()),
Copy link
Member

@xxchan xxchan Sep 25, 2024

Choose a reason for hiding this comment

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

nit style improvement

Suggested change
match self.op.list(&self.path).await {
Ok(_) => Ok(()),
Err(e) => Err(anyhow!(e)
.context("Fail to create sink, please check your config.")
.into()),
_ = self.op.list(&self.path).await.with_context(|| format!("failed to list path: {}", self.path))

Besides, "Fail to create sink, please check your config." doesn't provide useful information to users. If we want to add this, it should be in upper layer, e.g., CREATE SINK handler, instead of here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Fail to create sink, please check your config." doesn't provide useful information to users

The specific failure reason will be output below this line, so the user can get the specific information through the error.

Caused by these errors (recent errors listed first):
  1: gRPC request to meta service failed: Internal error
  2: failed to validate sink
  3: Fail to create sink, please check your config.
  4: PermissionDenied (persistent) at List::next, context: { uri: http://127.0.0.1:9301/hummock001?delimiter=%2F&list-type=2&prefix=test2, response: Parts { status: 403, version: HTTP/1.1, headers: {“connection”: “close”, “content-length”: “407", “accept-ranges”: “bytes”, “content-type”: “application/xml”, “date”: “Thu, 26 Sep 2024 06:17:52 GMT”, “server”: “MinIO”, “strict-transport-security”: “max-age=31536000; includeSubDomains”, “vary”: “Origin”, “vary”: “Accept-Encoding”, “x-amz-id-2”: “5e0466557790194f71acb9d44341f26b381bbf7ca42536c367b0a3b121df5c06", “x-amz-request-id”: “17F8B6D2A6E07AF0", “x-content-type-options”: “nosniff”, “x-xss-protection”: “1; mode=block”} }, service: s3, path: test2, listed: 0 } => S3Error { code: “SignatureDoesNotMatch”, message: “The request signature we calculated does not match the signature you provided. Check your key and signing method.“, resource: “/hummock001”, request_id: “17F8B6D2A6E07AF0" }

Copy link
Member

@xxchan xxchan Sep 26, 2024

Choose a reason for hiding this comment

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

I mean this sentence "3: Fail to create sink, please check your config" doesn't add any value.

Line 2 (general message) and line 4 (specific message) are useful. Line 3 are similar to line 2

So we should either remove line 3, or merge it into line 2.

@graphite-app graphite-app bot requested a review from a team September 26, 2024 07:25
@wcy-fdu wcy-fdu enabled auto-merge September 26, 2024 09:08
@wcy-fdu wcy-fdu added this pull request to the merge queue Sep 26, 2024
Merged via the queue into main with commit f394288 Sep 26, 2024
29 of 30 checks passed
@wcy-fdu wcy-fdu deleted the wcy/validate_sink_in_frontend.pr branch September 26, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validate file sink when creating instead of when actually sinking data
3 participants