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

3.x: Add RackAwareRoundRobinPolicy (second version) #227

Merged
merged 3 commits into from
Jul 7, 2023

Commits on Jul 7, 2023

  1. Add RackAwareRoundRobinPolicy

    RackAwareRoundRobinPolicy is a modified version of 
    DCAwareRoundRobinPolicy. The new policy shares much of the code with
    the original policy, but changes the logic of newQueryPlan - it will
    return hosts in local rack first, followed by remote racks in local DC, 
    followed by remote DC.
    
    In contrast to the approach in scylladb#199, this policy does not change the 
    distance() method - it will return LOCAL for both local rack in local DC
    and remote racks in local DC. This is a deliberate choice, as many other
    places in the driver look at the distance and introducing a new distance
    type (e.g. LOCAL_REMOTERACK) would necessitate many changes. One example
    of that is PoolingOptions, where the user can specify how many 
    connections should be made to LOCAL/REMOTE nodes - adding another type
    of distance would force the user to remember to change yet another
    configuration parameter.
    
    Integration tests in RackAwareRoundRobinPolicyTest are based on tests
    in DCAwareRoundRobinPolicyTest, as much of the behavior should be
    the same between the policies. A couple new tests were introduced to
    specifically test the rack-aware feature in local DC.
    avelanarius committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    ede6dcc View commit details
    Browse the repository at this point in the history
  2. Increase timeout in ScassandraCluster

    On my local system some Scassandra nodes sometimes take a long time
    to shut down and the previous 10 second value was insufficient.
    avelanarius committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    92de297 View commit details
    Browse the repository at this point in the history
  3. Reduce the number of queries in integration tests

    Reduce the number of queries that are executed in DCAwareRoundRobinPolicyTest
    and RackAwareRoundRobinPolicyTest, as we observed that on GitHub Actions
    the test would be flaky, failing with:
    
    <com.datastax.driver.core.exceptions.TransportException: [/127.0.1.1:34153] Connection has been closed>
    
    Unfortunately this error could not be reproduced locally.
    avelanarius committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    0b003c3 View commit details
    Browse the repository at this point in the history