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

refactor(connector): replace hyper client implementation with reqwest #16146

Merged
merged 9 commits into from
Apr 11, 2024

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Apr 4, 2024

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

What's changed and what's your intention?

hyper::Client is deprecated in hyper v1 because it's considered to be higher-level.
We'd better switch to reqwest for high-level HTTP client.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

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.

Copy link
Member Author

BugenZhao commented Apr 4, 2024

@BugenZhao BugenZhao requested review from xiangjinwu, wenym1, xxhZs and xxchan and removed request for a team April 4, 2024 09:31
Copy link
Contributor

@wenym1 wenym1 left a comment

Choose a reason for hiding this comment

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

@xxhZs PTAL

Can you run sink benchmark on the related sinks to see if the change affect the sink performance? You may ask @xxhZs for details about the sink benchmark.

@@ -190,18 +190,9 @@ impl ClickHouseEngine {
}
}

const POOL_IDLE_TIMEOUT: Duration = Duration::from_secs(5);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is is ok to remove this POOL_IDLE_TIMEOUT setting? I guess the original purpose not to use ClickHouseClient::default() is to set this config. cc @xxhZs

Copy link
Contributor

@xxhZs xxhZs Apr 8, 2024

Choose a reason for hiding this comment

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

The corresponding pr is this one, https://github.com/risingwavelabs/risingwave/pull/12041/files
If we do not set, the default value of POOL_IDLE_TIMEOUT is 2s in clickhouse.rs, the reason for not using the default here is to support https urls

Copy link
Contributor

Choose a reason for hiding this comment

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

If so, we may not modify the code here? @BugenZhao

Copy link
Member Author

@BugenZhao BugenZhao Apr 8, 2024

Choose a reason for hiding this comment

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

the reason for not using the default here is to support https urls

I didn't find the clue for this. The reason why #12041 works is explained in ClickHouse/clickhouse-rs#58 (comment). There seems nothing to do with the POOL_IDLE_TIMEOUT.

BTW, the upstream has submitted a fix (risingwavelabs/clickhouse.rs@3fc12f6) and there's no more need for this workaround. Should we sync the changes instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

May need to run a test to connect to clickhouse with https. If it passes, we can then sync the change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Cherry-picked the fix into our fork of clickhouse.rs.

Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao requested a review from wenym1 April 9, 2024 06:22
Base automatically changed from bz/less-hyper-1 to main April 9, 2024 08:48
Signed-off-by: Bugen Zhao <[email protected]>
Copy link
Contributor

@xxhZs xxhZs left a comment

Choose a reason for hiding this comment

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

lgtm

.await
.map_err(|err| SinkError::DorisStarrocksConnect(err.into()))?;
// TODO: shall we let `reqwest` handle the redirect?
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, I wonder if the logic of the following special verdict is an obstacle cc @xuefengze

@BugenZhao BugenZhao added this pull request to the merge queue Apr 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 11, 2024
@BugenZhao
Copy link
Member Author

#15429 introduced another occurrence. 🤡🤡

Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao added this pull request to the merge queue Apr 11, 2024
Merged via the queue into main with commit bdde2a7 Apr 11, 2024
31 of 32 checks passed
@BugenZhao BugenZhao deleted the bz/less-hyper-2 branch April 11, 2024 09:42
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.

4 participants