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

The --disable_yb_load_balancing_policy sample apps flag is not working #654

Closed
mbautin opened this issue Dec 12, 2018 · 0 comments
Closed
Assignees
Labels
kind/bug This issue is a bug kind/enhancement This is an enhancement of an existing feature

Comments

@mbautin
Copy link
Collaborator

mbautin commented Dec 12, 2018

As @robertpang noticed, we have this code

  protected void setupLoadBalancingPolicy(Cluster.Builder builder) {
    if (appConfig.localDc != null && !appConfig.localDc.isEmpty()) {
      builder.withLoadBalancingPolicy(new PartitionAwarePolicy(
              DCAwareRoundRobinPolicy.builder()
                      .withLocalDc(appConfig.localDc)
                      .withUsedHostsPerRemoteDc(Integer.MAX_VALUE)
                      .allowRemoteDCsForLocalConsistencyLevel()
                      .build()));
    } else if (!appConfig.disableYBLoadBalancingPolicy) {
      builder.withLoadBalancingPolicy(
              new PartitionAwarePolicy());
    }
  }

in AppBase.java, but in case none of the if branches are being hit (i.e. when --disable_yb_load_balancing_policy is specified on the command line) the custom YB Cassandra Java driver is actually using our PartitionAwarePolicy by default. Therefore to implement --disable_yb_load_balancing_policy correctly, we need to specify the default Cassandra load balancing policy explicitly in the above function.

@kmuthukk kmuthukk added the kind/enhancement This is an enhancement of an existing feature label Dec 12, 2018
@mbautin mbautin added kind/bug This issue is a bug kind/enhancement This is an enhancement of an existing feature and removed kind/enhancement This is an enhancement of an existing feature labels Dec 12, 2018
yugabyte-ci pushed a commit that referenced this issue Dec 20, 2018
Summary: Allow for disabling load balancer for cql load tester with --disable_yb_load_balancing_policy

Test Plan: tested by running the load tester with --disable_yb_load_balancing_policy

Reviewers: robert

Reviewed By: robert

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D5875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue is a bug kind/enhancement This is an enhancement of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants