Skip to main content

build_mysql_election

Function build_mysql_election 

Source
pub async fn build_mysql_election(
    store_addrs: &[String],
    tls_config: Option<&TlsOption>,
    leader_value: String,
    store_key_prefix: String,
    candidate_lease_ttl: Duration,
    meta_lease_ttl: Duration,
    election_table_name: &str,
    innodb_lock_wait_timeout: Duration,
) -> Result<ElectionRef>
Expand description

Builds a MySQL-backed election implementation.

  • store_addrs - MySQL connection URLs; only the first address is used.
  • tls_config - optional TLS settings for the MySQL connection.
  • leader_value - advertised address of this election candidate.
  • store_key_prefix - prefix for election and candidate keys.
  • candidate_lease_ttl - TTL for registered candidate metadata.
  • meta_lease_ttl - TTL for the elected leader metadata.
  • election_table_name - dedicated table used for election locking and records.
  • innodb_lock_wait_timeout - session lock wait timeout for election transactions.