diff --git a/config/config.md b/config/config.md index 7f48597737d3..d865a83ad7a1 100644 --- a/config/config.md +++ b/config/config.md @@ -168,7 +168,6 @@ | Key | Type | Default | Descriptions | | --- | -----| ------- | ----------- | -| `mode` | String | `standalone` | The running mode of the datanode. It can be `standalone` or `distributed`. | | `default_timezone` | String | `None` | The default timezone of the server. | | `runtime` | -- | -- | The runtime options. | | `runtime.read_rt_size` | Integer | `8` | The number of threads to execute the runtime for global read operations. | diff --git a/config/frontend.example.toml b/config/frontend.example.toml index 6c2bddbc528c..3def69cfacb7 100644 --- a/config/frontend.example.toml +++ b/config/frontend.example.toml @@ -1,6 +1,3 @@ -## The running mode of the datanode. It can be `standalone` or `distributed`. -mode = "standalone" - ## The default timezone of the server. ## +toml2docs:none-default default_timezone = "UTC" diff --git a/src/cmd/src/frontend.rs b/src/cmd/src/frontend.rs index 96d608c709a4..ae8639f1a000 100644 --- a/src/cmd/src/frontend.rs +++ b/src/cmd/src/frontend.rs @@ -243,7 +243,6 @@ impl StartCommand { .get_or_insert_with(MetaClientOptions::default) .metasrv_addrs .clone_from(metasrv_addrs); - opts.mode = Mode::Distributed; } if let Some(user_provider) = &self.user_provider { @@ -317,7 +316,7 @@ impl StartCommand { ); let catalog_manager = KvBackendCatalogManager::new( - opts.mode, + Mode::Distributed, Some(meta_client.clone()), cached_meta_backend.clone(), layered_cache_registry.clone(), @@ -448,7 +447,6 @@ mod tests { let fe_opts = command.load_options(&Default::default()).unwrap().component; - assert_eq!(Mode::Distributed, fe_opts.mode); assert_eq!("127.0.0.1:4000".to_string(), fe_opts.http.addr); assert_eq!(Duration::from_secs(30), fe_opts.http.timeout); diff --git a/src/cmd/src/standalone.rs b/src/cmd/src/standalone.rs index f5cf3b02f62b..ba25ab555f7c 100644 --- a/src/cmd/src/standalone.rs +++ b/src/cmd/src/standalone.rs @@ -182,7 +182,6 @@ impl StandaloneOptions { pub fn frontend_options(&self) -> FrontendOptions { let cloned_opts = self.clone(); FrontendOptions { - mode: cloned_opts.mode, default_timezone: cloned_opts.default_timezone, http: cloned_opts.http, grpc: cloned_opts.grpc, @@ -636,7 +635,6 @@ mod tests { use common_test_util::temp_dir::create_named_temp_file; use common_wal::config::DatanodeWalConfig; use datanode::config::{FileConfig, GcsConfig}; - use servers::Mode; use super::*; use crate::options::GlobalOptions; @@ -736,7 +734,6 @@ mod tests { let fe_opts = options.frontend_options(); let dn_opts = options.datanode_options(); let logging_opts = options.logging; - assert_eq!(Mode::Standalone, fe_opts.mode); assert_eq!("127.0.0.1:4000".to_string(), fe_opts.http.addr); assert_eq!(Duration::from_secs(33), fe_opts.http.timeout); assert_eq!(ReadableSize::mb(128), fe_opts.http.body_limit); diff --git a/src/frontend/src/frontend.rs b/src/frontend/src/frontend.rs index e8a9b7a47ef9..91ee443af7a8 100644 --- a/src/frontend/src/frontend.rs +++ b/src/frontend/src/frontend.rs @@ -20,7 +20,6 @@ use servers::export_metrics::ExportMetricsOption; use servers::grpc::GrpcOptions; use servers::heartbeat_options::HeartbeatOptions; use servers::http::HttpOptions; -use servers::Mode; use crate::service_config::{ DatanodeOptions, InfluxdbOptions, MysqlOptions, OpentsdbOptions, OtlpOptions, PostgresOptions, @@ -30,7 +29,6 @@ use crate::service_config::{ #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(default)] pub struct FrontendOptions { - pub mode: Mode, pub node_id: Option, pub default_timezone: Option, pub heartbeat: HeartbeatOptions, @@ -53,7 +51,6 @@ pub struct FrontendOptions { impl Default for FrontendOptions { fn default() -> Self { Self { - mode: Mode::Standalone, node_id: None, default_timezone: None, heartbeat: HeartbeatOptions::frontend_default(), diff --git a/src/frontend/src/server.rs b/src/frontend/src/server.rs index a80415076195..98c138cfb4ea 100644 --- a/src/frontend/src/server.rs +++ b/src/frontend/src/server.rs @@ -143,7 +143,15 @@ where }; let user_provider = self.plugins.get::(); - let runtime = match opts.mode { + + // Determine whether it is Standalone or Distributed mode based on whether the meta client is configured. + let mode = if opts.meta_client.is_none() { + Mode::Standalone + } else { + Mode::Distributed + }; + + let runtime = match mode { Mode::Standalone => Some(builder.runtime().clone()), _ => None, };