mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-22 22:20:02 +00:00
fix(metasrv)!: do not overwrite boolean options unconditionally (#2161)
* fix: do not overwrite boolean options unconditionally Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix sqlness start command Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -91,9 +91,9 @@ struct StartCommand {
|
||||
#[clap(short, long)]
|
||||
selector: Option<String>,
|
||||
#[clap(long)]
|
||||
use_memory_store: bool,
|
||||
use_memory_store: Option<bool>,
|
||||
#[clap(long)]
|
||||
disable_region_failover: bool,
|
||||
disable_region_failover: Option<bool>,
|
||||
#[clap(long)]
|
||||
http_addr: Option<String>,
|
||||
#[clap(long)]
|
||||
@@ -136,9 +136,13 @@ impl StartCommand {
|
||||
.context(error::UnsupportedSelectorTypeSnafu { selector_type })?;
|
||||
}
|
||||
|
||||
opts.use_memory_store = self.use_memory_store;
|
||||
if let Some(use_memory_store) = self.use_memory_store {
|
||||
opts.use_memory_store = use_memory_store;
|
||||
}
|
||||
|
||||
opts.disable_region_failover = self.disable_region_failover;
|
||||
if let Some(disable_region_failover) = self.disable_region_failover {
|
||||
opts.disable_region_failover = disable_region_failover;
|
||||
}
|
||||
|
||||
if let Some(http_addr) = &self.http_addr {
|
||||
opts.http_opts.addr = http_addr.clone();
|
||||
|
||||
@@ -106,7 +106,11 @@ pub enum Error {
|
||||
#[snafu(display("Empty key is not allowed"))]
|
||||
EmptyKey { location: Location },
|
||||
|
||||
#[snafu(display("Failed to execute via Etcd, source: {}", source))]
|
||||
#[snafu(display(
|
||||
"Failed to execute via Etcd, source: {}, location: {}",
|
||||
source,
|
||||
location
|
||||
))]
|
||||
EtcdFailed {
|
||||
source: etcd_client::Error,
|
||||
location: Location,
|
||||
|
||||
@@ -177,8 +177,10 @@ impl Env {
|
||||
subcommand.to_string(),
|
||||
"start".to_string(),
|
||||
"--use-memory-store".to_string(),
|
||||
"true".to_string(),
|
||||
"--http-addr=127.0.0.1:5001".to_string(),
|
||||
"--disable-region-failover".to_string(),
|
||||
"true".to_string(),
|
||||
];
|
||||
(args, METASRV_ADDR.to_string())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user