From 12260fee7ea00553db4782669a1c787d80f8f4df Mon Sep 17 00:00:00 2001 From: CookiePieWw Date: Fri, 20 Dec 2024 19:36:49 +0800 Subject: [PATCH] fix: shadow the election client for now --- src/meta-srv/src/bootstrap.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) 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) } };