Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
Signed-off-by: CalvinNeo <[email protected]>
  • Loading branch information
CalvinNeo committed Aug 31, 2022
1 parent f047387 commit 937c6b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion components/proxy_server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,14 @@ pub fn check_critical_config(config: &TiKvConfig) -> Result<(), String> {
// Check current critical configurations with last time, if there are some
// changes, user must guarantee relevant works have been done.
if let Some(mut cfg) = get_last_config(&config.storage.data_dir) {
info!("check_critical_config finished compatible_adjust");
cfg.compatible_adjust();
if let Err(e) = cfg.validate() {
warn!("last_tikv.toml is invalid but ignored: {:?}", e);
}
info!("check_critical_config finished validate");
config.check_critical_cfg_with(&cfg)?;
info!("check_critical_config finished check_critical_cfg_with");
}
Ok(())
}
Expand All @@ -179,7 +182,7 @@ pub fn get_last_config(data_dir: &str) -> Option<TiKvConfig> {
let last_cfg_path = store_path.join(LAST_CONFIG_FILE);
let mut v: Vec<String> = vec![];
if last_cfg_path.exists() {
let s = TiKvConfig::from_file(&last_cfg_path, None).unwrap_or_else(|e| {
let s = TiKvConfig::from_file(&last_cfg_path, Some(&mut v)).unwrap_or_else(|e| {
error!(
"invalid auto generated configuration file {}, err {}",
last_cfg_path.display(),
Expand Down
5 changes: 3 additions & 2 deletions components/proxy_server/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ pub fn gen_tikv_config(
},
)
.unwrap_or_else(|e| {
panic!(
"invalid auto generated configuration file {}, err {}",
error!(
"invalid default auto generated configuration file {}, err {}",
path.display(),
e
);
std::process::exit(1);
})
})
}
Expand Down
3 changes: 0 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3281,13 +3281,10 @@ pub fn check_critical_config(config: &TiKvConfig) -> Result<(), String> {
// changes, user must guarantee relevant works have been done.
if let Some(mut cfg) = get_last_config(&config.storage.data_dir) {
cfg.compatible_adjust();
info!("check_critical_config finished compatible_adjust");
if let Err(e) = cfg.validate() {
warn!("last_tikv.toml is invalid but ignored: {:?}", e);
}
info!("check_critical_config finished validate");
config.check_critical_cfg_with(&cfg)?;
info!("check_critical_config finished check_critical_cfg_with");
}
Ok(())
}
Expand Down

0 comments on commit 937c6b0

Please sign in to comment.