Skip to content

Allow disabling statement preparation on all hosts #1284

@muzarski

Description

@muzarski

This would directly correspond to cass_cluster_set_prepare_on_all_hosts.

Statement preparation in cpp-driver

  • The statement is firstly prepared on one host - this host is chosen based on the plan created from session's default load balancing policy. Retries are done, wrt. session's default retry policy.
  • If the statement was successfully prepared on one host, and prepared_on_all_hosts flag is set to true, then the driver prepares the statement on the remaining hosts simultaneously.

Statement preparation in rust-driver (current approach)

We by default prepare statement on all shards (all connections of each host) simultaneously. If preparation was successful on at least one connection, and statement ids match, we consider whole operation to be successful.

Implementation

We need to discuss how to approach this in rust-driver. Some questions that need to be answered (assuming that prepare_on_all_hosts is disabled):

  • Which host to choose? Possible solutions:
    • pick random node
    • pick the node based on Session's default LBP
  • Should preparation failure be a subject to retry? If so, then it should probably be implemented using Session's default LBP and retry policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cpp-rust-driver-p2Functionality required by cpp-rust-driver

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions