diff --git a/src/meta-srv/src/bootstrap.rs b/src/meta-srv/src/bootstrap.rs index 5a4cd1284227..cdc9f579c2c2 100644 --- a/src/meta-srv/src/bootstrap.rs +++ b/src/meta-srv/src/bootstrap.rs @@ -45,13 +45,7 @@ use tonic::codec::CompressionEncoding; use tonic::transport::server::{Router, TcpIncoming}; use crate::election::etcd::EtcdElection; -#[cfg(feature = "pg_kvbackend")] -use crate::election::postgres::PgElection; -#[cfg(feature = "pg_kvbackend")] -use crate::election::CANDIDATE_LEASE_SECS; -#[cfg(feature = "pg_kvbackend")] -use crate::error::InvalidArgumentsSnafu; -use crate::error::{InitExportMetricsTaskSnafu, TomlFormatSnafu}; +use crate::error::{InitExportMetricsTaskSnafu, InvalidArgumentsSnafu, TomlFormatSnafu}; use crate::metasrv::builder::MetasrvBuilder; use crate::metasrv::{BackendImpl, Metasrv, MetasrvOptions, SelectorRef}; use crate::selector::lease_based::LeaseBasedSelector; @@ -231,15 +225,7 @@ pub async fn metasrv_builder( let kv_backend = PgStore::with_pg_client(pg_client) .await .context(error::KvBackendSnafu)?; - let election_client = create_postgres_client(opts).await?; - let election = PgElection::with_pg_client( - opts.server_addr.clone(), - election_client, - opts.store_key_prefix.clone(), - CANDIDATE_LEASE_SECS, - ) - .await?; - (kv_backend, Some(election)) + (kv_backend, None) } };