-
Notifications
You must be signed in to change notification settings - Fork 110
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
Shard selecting load balancing #944
Conversation
7d17d2a
to
3a79c2f
Compare
latency_awareness: Option<LatencyAwareness>, | ||
fixed_shuffle_seed: Option<u64>, | ||
fixed_seed: Option<u64>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Justification for this name change: the seed is now not only used for shuffling nodes, but also for sampling a random shard in case we don't know the proper one.
3a79c2f
to
13fca82
Compare
e6bb969
to
cf8e21b
Compare
This way, we avoid clones of datacenters that appear multiple times.
This is more readable in my opinion. Co-authored-by: Wojciech Przytuła <[email protected]>
For now the returned shards will be ignored by rest of the code. Previously shard calculations were done by ConnectionPool, but in order to allow shard-aware LoadBalancingPolicy to exist, it must get sharded replicas from locator. Co-authored-by: Wojciech Przytuła <[email protected]>
Co-authored-by: Wojciech Przytuła <[email protected]>
Co-authored-by: Wojciech Przytuła <[email protected]>
Co-authored-by: Wojciech Przytuła <[email protected]>
Co-authored-by: Wojciech Przytuła <[email protected]>
cf8e21b
to
48aa642
Compare
|
Well, that's unfortunately not true, but it's a known limitation of The key takeaway is to not trust |
The message indeed sounds too confident, perhaps we should add some caution about the possible false negatives. |
86c03dd
to
16dcc19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, some nits only.
This commit also includes some changes that were omitted during older changes to LBP.
16dcc19
to
28ae015
Compare
This is a more polished version of #791
The changes from #791 are:
Posting the original description, slightly modified, as it is still relevant:
Motivation
Most of our drivers, being inherited from Cassandra, load balance only over nodes, not specific shards. Multiple ideas have arised that could benefit from having a shard-selecting load balancing. Among them:
with tablets enabled (ATM experimental in ScyllaDB), target shard is not derived from token (computed from partition key), but rather read from
system.tablets
. Therefore, a load balancer should be able to decide a target shard on its own, by abstracting over either token ring or tablets being used for cluster topology.some tests have shown that sometimes, when a shard is particularly overloaded, it may be beneficial (performance-wise) to send the request to the proper node, but a wrong shard. That shard would then do part of the work that the overloaded shard would else have to do itself.
Design
(NodeRef, Shard)
pair, enabling finer-grained control over targeted shards.ReplicaLocator
is the place where the abstraction over either token ring or tablets is to be implemented. Ideally, the LB policy does not have to be aware of the actual mechanism (token ring or tablets) being used for a particular query.What's done
NodeRef
to(NodeRef, Shard)
pair,NodeConnectionPool
; a method is added there that returns a connection to a specific shard,Session
's logic propagates the load balancing policy's target shard down to the connection pool,ReplicaLocator
. At the moment, it simply computes the shard based on the token, the same way as it was done in the connection pool layer before.Pre-review checklist
./docs/source/
.Fixes:
annotations to PR description.