From 6ab3a88042387b4700392309cfe461df2f24614b Mon Sep 17 00:00:00 2001 From: shuiyisong <113876041+shuiyisong@users.noreply.github.com> Date: Fri, 2 Feb 2024 18:36:08 +0800 Subject: [PATCH] fix: use `fe_opts` after `setup_frontend_plugins` in standalone (#3275) * chore: modify standalone startup opts * chore: move frontend and datanode options --- src/cmd/src/standalone.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/cmd/src/standalone.rs b/src/cmd/src/standalone.rs index 40611a11d3..0ff334e8da 100644 --- a/src/cmd/src/standalone.rs +++ b/src/cmd/src/standalone.rs @@ -368,20 +368,18 @@ impl StartCommand { #[allow(unused_variables)] #[allow(clippy::diverging_sub_expression)] async fn build(self, opts: MixOptions) -> Result { - let mut fe_opts = opts.frontend.clone(); + info!("Standalone start command: {:#?}", self); + info!("Building standalone instance with {opts:#?}"); + + let mut fe_opts = opts.frontend; #[allow(clippy::unnecessary_mut_passed)] let fe_plugins = plugins::setup_frontend_plugins(&mut fe_opts) // mut ref is MUST, DO NOT change it .await .context(StartFrontendSnafu)?; - let dn_opts = opts.datanode.clone(); + let dn_opts = opts.datanode; - info!("Standalone start command: {:#?}", self); - - info!("Building standalone instance with {opts:#?}"); - - set_default_timezone(opts.frontend.default_timezone.as_deref()) - .context(InitTimezoneSnafu)?; + set_default_timezone(fe_opts.default_timezone.as_deref()).context(InitTimezoneSnafu)?; // Ensure the data_home directory exists. fs::create_dir_all(path::Path::new(&opts.data_home)).context(CreateDirSnafu { @@ -437,11 +435,11 @@ impl StartCommand { .await .context(StartFrontendSnafu)?; - let servers = Services::new(opts.clone(), Arc::new(frontend.clone()), fe_plugins) + let servers = Services::new(fe_opts.clone(), Arc::new(frontend.clone()), fe_plugins) .build() .context(StartFrontendSnafu)?; frontend - .build_servers(opts, servers) + .build_servers(fe_opts, servers) .context(StartFrontendSnafu)?; Ok(Instance {