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

feat(source): introduce gcs source and new s3 source via OpenDAL #13414

Merged
merged 57 commits into from
Dec 18, 2023

Conversation

wcy-fdu
Copy link
Contributor

@wcy-fdu wcy-fdu commented Nov 14, 2023

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

What's changed and what's your intention?

Background:

  • The previous design is based on the assumption that file names are evenly distributed on vnodes, so we don't have any ordering guarantee for records across files.
  • During recovery, it may cause fetching to stop after part of a file has been fetched, and then continue to fetch the remaining part of the original file after fetching other files. This is expected behavior.
  • There is a dedup executor sitting in between lister and fetcher to dedup file name.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • 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 a team as a code owner November 14, 2023 08:52
@wcy-fdu wcy-fdu marked this pull request as draft November 14, 2023 08:52
Copy link

gitguardian bot commented Nov 14, 2023

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id Secret Commit Filename
7648795 Generic CLI Secret 02f63ee integration_tests/iceberg-cdc/docker-compose.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@wcy-fdu wcy-fdu marked this pull request as ready for review November 24, 2023 07:18
@wcy-fdu wcy-fdu requested review from hzxa21 and tabVersion November 24, 2023 07:18
@wcy-fdu wcy-fdu requested a review from tabVersion December 12, 2023 11:28
@wcy-fdu
Copy link
Contributor Author

wcy-fdu commented Dec 13, 2023

Testing gcs source in ci is not ready yet, but I think maybe we can add it in next pr because we already test s3 source in ci.


let t = match om.last_modified() {
Some(t) => t,
None => DateTime::<Utc>::from_timestamp(0, 0).unwrap_or_default(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This means we use January 1, 1970 0:00:00 for the mtime. Is this expected?

Comment on lines +151 to +152
batch.push(msg);
if batch.len() >= max_chunk_size {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just realized yesterday, RW can be vulnerable in this case.

Do you mean that the msg returned in ReaderStream can be arbitarily large?

#[derive(Clone, Debug)]
pub struct FsPageItem {
pub name: String,
pub size: i64,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we use i64 instead of u64 for size?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@tabVersion tabVersion Dec 15, 2023

Choose a reason for hiding this comment

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

because s3 objects from aws sdk is of type Option<i64>
since we are not reusing FsSplit it is ok to change to u64 here

Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@tabVersion tabVersion 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 your effort

Comment on lines +151 to +152
batch.push(msg);
if batch.len() >= max_chunk_size {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just realized yesterday, RW can be vulnerable in this case.

Do you mean that the msg returned in ReaderStream can be arbitarily large?

parser holds a buffer to handle truncated files. But if there are no delimiter found, the buffer can be really large. Let's fix this in another pr

@wcy-fdu wcy-fdu added this pull request to the merge queue Dec 18, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2023
@wcy-fdu wcy-fdu added this pull request to the merge queue Dec 18, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2023
@wcy-fdu wcy-fdu added this pull request to the merge queue Dec 18, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2023
@wcy-fdu wcy-fdu added this pull request to the merge queue Dec 18, 2023
Merged via the queue into main with commit a9def98 Dec 18, 2023
26 of 28 checks passed
@wcy-fdu wcy-fdu deleted the wcy/gcs_source branch December 18, 2023 17:40
Comment on lines +30 to +31
// The new s3_v2 will use opendal.
pub const OPENDAL_S3_CONNECTOR: &str = "s3_v2";
Copy link
Member

Choose a reason for hiding this comment

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

This is a little confusing to me (without the background). IIUC, s3 v2 refers to the new algorithm, while opendal refers to an orthogonal aspect.

Could you tell me the reasons to use opendal for s3 v2, or points me to related discussions?

BTW, I think using S3_V2 as the variable name might be clearer than OPENDAL_S3.

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.

6 participants