scylladb / cpp-rust-driver

API-compatible rewrite of https://github.com/scylladb/cpp-driver as a wrapper for Rust driver.
GNU Lesser General Public License v2.1
16 stars 11 forks source link

exec_profile: Use cluster lbp for exec profiles by default #197

Closed muzarski closed 4 days ago

muzarski commented 1 month ago

The documentation of cass_execution_profile_set_load_balance_... functions states:

 <b>Note:</b> Profile-based load balancing policy is disabled by default.
 cluster load balancing policy is used when profile does not contain a policy.

It seems to be true, see: https://github.com/scylladb/cpp-driver/blob/master/src/request_processor.cpp#L196-L209.

We should adjust cpp-rust-driver so it behaves the same way.

This PR consist mostly of some refactor commits that prepare for the logic change in the last commit.

Pre-review checklist

muzarski commented 1 month ago

v2: Reverted the changes introduced by lbp_config: move LoadBalancingKind to upper layer (removed this commit). Now, the load_balancing_kind field is optional in LoadBalancingConfig.

muzarski commented 3 weeks ago

v3: Rebased on https://github.com/scylladb/cpp-rust-driver/pull/200. Addressed all of @Lorak-mmk comments

muzarski commented 3 weeks ago

Rebased on master