Code review fixes

This commit is contained in:
Kirill Bulatov
2022-02-09 11:05:14 +02:00
committed by Kirill Bulatov
parent 6eef401602
commit 7c1c7702d2
3 changed files with 17 additions and 8 deletions

View File

@@ -334,8 +334,9 @@ impl VirtualFile {
// library RwLock doesn't allow downgrading without releasing the lock,
// and that doesn't seem worth the trouble.
//
// XXX `parking_lot::RwLock` can enable such downgrades, yet its implemenation is fair and
// may deadlock on subsequent read calls, not all code places would benefit from such benaviour
// XXX: `parking_lot::RwLock` can enable such downgrades, yet its implemenation is fair and
// may deadlock on subsequent read calls.
// Simply replacing all `RwLock` in project causes deadlocks, so use it sparingly.
let result = STORAGE_IO_TIME
.with_label_values(&[op, &self.tenantid, &self.timelineid])
.observe_closure_duration(|| func(&file));

View File

@@ -67,9 +67,17 @@ struct BranchTreeEl {
// * Providing CLI api to the pageserver
// * TODO: export/import to/from usual postgres
fn main() -> Result<()> {
let pg_node_arg = Arg::new("node").index(1).help("Node name").required(true);
#[rustfmt::skip] // rustfmt squashes these into a single line otherwise
let pg_node_arg = Arg::new("node")
.index(1)
.help("Node name")
.required(true);
let safekeeper_node_arg = Arg::new("node").index(1).help("Node name").required(false);
#[rustfmt::skip]
let safekeeper_node_arg = Arg::new("node")
.index(1)
.help("Node name")
.required(false);
let timeline_arg = Arg::new("timeline")
.index(2)
@@ -442,7 +450,7 @@ fn handle_tenant(tenant_match: &ArgMatches, env: &local_env::LocalEnv) -> Result
println!("tenant successfully created on the pageserver");
}
Some((sub_name, _)) => bail!("Unexpected tenant subcommand '{}'", sub_name),
None => bail!("No tenant subcommand found"),
None => bail!("no tenant subcommand provided"),
}
Ok(())
}
@@ -614,7 +622,7 @@ fn handle_pageserver(sub_match: &ArgMatches, env: &local_env::LocalEnv) -> Resul
}
}
Some((sub_name, _)) => bail!("Unexpected pageserver subcommand '{}'", sub_name),
None => bail!("No pageserver subcommand given"),
None => bail!("no pageserver subcommand provided"),
}
Ok(())
}

View File

@@ -3,6 +3,6 @@ pub mod error;
pub mod json;
pub mod request;
/// Current fast way to applly simple http routing in varuious Zenith binaries.
/// Reexported for sake of uniform approach, that could be later replaced with better alternatives, if needed.
/// Current fast way to apply simple http routing in various Zenith binaries.
/// Re-exported for sake of uniform approach, that could be later replaced with better alternatives, if needed.
pub use routerify::{ext::RequestExt, RouterBuilder};