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(streaming): follow server.connection_pool_size config for exchange service #17755

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Jul 19, 2024

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

What's changed and what's your intention?

A connection_pool_size can be specified to establish multiple connections to the same server. We didn't pass this configuration field to the client pool used by streaming exchange, which is the issue to address in this PR.

This can help to mitigate potential streaming stuck due to the deadlock caused by HTTP/2 streaming vs connection-level flow control.

Remove Default impl to make specifying the connection_pool_size explicit to caller. Use adhoc() or new(1) if the caller doesn't care about the pool size.

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
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

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

LGTM. The reason we introduced a connection pool previously is that a single connection became a bottleneck for batch queries between frontend nodes and compute nodes. If the bottleneck appears in the streaming exchange channel, using a connection pool seems promising to resolve deadlocks.

Copy link
Contributor

@kwannoel kwannoel left a comment

Choose a reason for hiding this comment

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

Generally LGTM. But I think an improvement would be to use a separate configuration for batch and streaming connection pools.

Currently both use the same connection_pool_size config, so batch and stream are not isolated for each other's configuration change for this var.

By default our connection pool size for stream is 1. Not sure if the same default can apply to batch.

@BugenZhao
Copy link
Member Author

But I think an improvement would be to use a separate configuration for batch and streaming connection pools.

Currently both use the same connection_pool_size config, so batch and stream are not isolated for each other's configuration change for this var.

Agree. Since connection_pool_size was only used for batch exchange, It would be better if it was put in batch.developer from the very beginning. Then we can introduce another configuration for streaming exchange, naturally and without any compatibility issue.

By default our connection pool size for stream is 1. Not sure if the same default can apply to batch.

After this PR, it will be 16, but I don't think it's harmful.

@BugenZhao BugenZhao added the need-cherry-pick-release-1.10 Open a cherry-pick PR to branch release-1.10 after the current PR is merged label Jul 22, 2024
@BugenZhao BugenZhao enabled auto-merge July 22, 2024 09:35
@BugenZhao BugenZhao disabled auto-merge July 22, 2024 09:47
@BugenZhao BugenZhao removed the need-cherry-pick-release-1.10 Open a cherry-pick PR to branch release-1.10 after the current PR is merged label Jul 22, 2024
@BugenZhao BugenZhao enabled auto-merge July 22, 2024 09:51
Copy link
Member Author

Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao added this pull request to the merge queue Jul 23, 2024
Merged via the queue into main with commit 2b15b8e Jul 23, 2024
31 of 32 checks passed
@BugenZhao BugenZhao deleted the bz/stream-client-pool branch July 23, 2024 04:42
@kwannoel kwannoel added the need-cherry-pick-release-1.10 Open a cherry-pick PR to branch release-1.10 after the current PR is merged label Jul 24, 2024
github-actions bot pushed a commit that referenced this pull request Jul 24, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jul 24, 2024
…ange service (#17755) (#17798)

Signed-off-by: Bugen Zhao <[email protected]>
Co-authored-by: Bugen Zhao <[email protected]>
kwannoel pushed a commit that referenced this pull request Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/run-e2e-single-node-tests need-cherry-pick-release-1.10 Open a cherry-pick PR to branch release-1.10 after the current PR is merged type/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants