-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Use DCAwareRoundRobinPolicy as fallback for TokenAwarePolicy #1285
Use DCAwareRoundRobinPolicy as fallback for TokenAwarePolicy #1285
Conversation
- Previously, RoundRobinPolicy would attempt cross-dc writes Signed-off-by: Prithvi Raj <[email protected]>
if c.LocalDC != "" { | ||
fallbackHostSelectionPolicy = gocql.DCAwareRoundRobinPolicy(c.LocalDC) | ||
} | ||
cluster.PoolConfig.HostSelectionPolicy = gocql.TokenAwareHostPolicy(fallbackHostSelectionPolicy, gocql.ShuffleReplicas()) |
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.
what does gocql.ShuffleReplicas()
do?
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.
There can be multiple replicas (equal to RF) for a given token. ShuffleReplicas
selects one of these replicas at random instead of deterministically selecting a replica.
plugin/storage/cassandra/options.go
Outdated
flagSet.String( | ||
nsConfig.namespace+suffixDC, | ||
nsConfig.LocalDC, | ||
"The Cassandra local data center for DC Aware host selection") |
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.
The Cassandra name of local data center...
Signed-off-by: Prithvi Raj <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1285 +/- ##
========================================
Coverage ? 100%
========================================
Files ? 161
Lines ? 7198
Branches ? 0
========================================
Hits ? 7198
Misses ? 0
Partials ? 0
Continue to review full report at Codecov.
|
Which problem is this PR solving?
Short description of the changes
DCAwareRoundRobin
as a fallback forTokenAwareHostPolicy