Skip to main content
Source

pub async fn switch_url( &self, old_url: &Url, old_num_cluster_switches: usize, ) -> Result<Url, KineticaError>

Switches to the next available cluster URL for HA failover.

This method:

  • Checks if failover is disabled
  • Checks if only one cluster exists (no failover possible)
  • Checks if another thread has already switched
  • Selects the next available cluster
  • Skips clusters that aren’t running
  • old_url - The URL that was in use when the failure occurred
  • old_num_cluster_switches - The switch count before this switch was initiated

The new URL to use, or an error if failover is not possible.