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

Use DCAwareRoundRobinPolicy as fallback for TokenAwarePolicy #1285

Merged
merged 3 commits into from
Jan 17, 2019

Conversation

vprithvi
Copy link
Contributor

  • Previously, RoundRobinPolicy would attempt cross-dc writes

Which problem is this PR solving?

  • When using a multi-datacenter Cassandra deploy, jaeger choses hosts in remote data centers. This is problematic for a variety of reasons
  • When configured with only local replicas, remote reads/writes fail entirely
  • When the Cassandra cluster is configured with multi zone replication, picking remote data centers results in lower performance

Short description of the changes

  • Use DCAwareRoundRobin as a fallback for TokenAwareHostPolicy

- 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())
Copy link
Contributor

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?

Copy link
Contributor Author

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.

flagSet.String(
nsConfig.namespace+suffixDC,
nsConfig.LocalDC,
"The Cassandra local data center for DC Aware host selection")
Copy link
Member

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...

@codecov
Copy link

codecov bot commented Jan 17, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@7cbb25d). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master   #1285   +/-   ##
========================================
  Coverage          ?    100%           
========================================
  Files             ?     161           
  Lines             ?    7198           
  Branches          ?       0           
========================================
  Hits              ?    7198           
  Misses            ?       0           
  Partials          ?       0
Impacted Files Coverage Δ
plugin/storage/cassandra/options.go 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7cbb25d...646b09d. Read the comment docs.

@yurishkuro yurishkuro merged commit bda811b into jaegertracing:master Jan 17, 2019
@ghost ghost removed the review label Jan 17, 2019
@vprithvi vprithvi deleted the update-cassandra-configs branch December 2, 2022 15:25
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.

3 participants