Skip to content

4.x: Add advanced shard awareness #517

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

Open
wants to merge 4 commits into
base: scylla-4.x
Choose a base branch
from

Conversation

Bouncheck
Copy link
Collaborator

@Bouncheck Bouncheck commented Apr 14, 2025

Adds advanced shard awareness to the 4.x version of the driver.
Added integration test that checks if reconnections are sufficiently rare with advanced shard awareness.
should_struggle_to_fill_pools and should_not_struggle_to_fill_pools can be run locally to see the difference between the driver with and without this feature.

Fixes #515

@Bouncheck Bouncheck self-assigned this Apr 14, 2025
@Bouncheck Bouncheck force-pushed the scylla-4.x-adv-shard-awareness branch 5 times, most recently from b2aa823 to f3dc5ef Compare April 14, 2025 21:59
@Bouncheck Bouncheck marked this pull request as ready for review April 14, 2025 21:59
@Bouncheck
Copy link
Collaborator Author

Bouncheck commented Apr 14, 2025

I'll probably introduce some small checks to port allocator (for example the range should not be too small) and some unit tests but the gist of the PR will probably look as it is now.

Adds config options for toggling the feature on and defining
port ranges to use.
By default the feature will be enabled.
With advanced shard awareness target shard is a necessary parameter
for connecting. Extends non public methods with new parameters and
provides one additional public method.
Passing `null` as shard id or ShardingInfo will lead to previous non-shard
aware behavior.
Makes `addMissingChannels` use advanced shard awareness.
It will now specify target shard when adding missing channels for
specific shards.
In case returned channels do not match requested shards warnings are logged.
Initial connection to the node works on previous rules, meaning it uses
arbitrary local port for connection to arbitrary shard.

Adds AdvancedShardAwarenessIT that has several methods displaying
the difference between establishing connections with option enabled
and disabled.
@Bouncheck Bouncheck force-pushed the scylla-4.x-adv-shard-awareness branch from f3dc5ef to 560a1f2 Compare April 14, 2025 22:20
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.

4.x: Advanced shard awareness
1 participant