Skip to content

Commit

Permalink
fix: use fe_opts after setup_frontend_plugins in standalone (#3275)
Browse files Browse the repository at this point in the history
* chore: modify standalone startup opts

* chore: move frontend and datanode options
  • Loading branch information
shuiyisong authored Feb 2, 2024
1 parent e89f5dc commit 6ab3a88
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/cmd/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,20 +368,18 @@ impl StartCommand {
#[allow(unused_variables)]
#[allow(clippy::diverging_sub_expression)]
async fn build(self, opts: MixOptions) -> Result<Instance> {
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();

info!("Standalone start command: {:#?}", self);

info!("Building standalone instance with {opts:#?}");
let dn_opts = opts.datanode;

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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6ab3a88

Please sign in to comment.