From d59cb2ca7a5698b3c68a01ae9c903ca45c2e5404 Mon Sep 17 00:00:00 2001 From: Stas Kelvich Date: Tue, 18 May 2021 15:39:22 +0300 Subject: [PATCH] clean up some leftovers after 746f66731 --- control_plane/src/compute.rs | 2 +- integration_tests/src/lib.rs | 10 ++-------- pageserver/src/branches.rs | 16 ---------------- zenith/Cargo.toml | 13 ------------- 4 files changed, 3 insertions(+), 38 deletions(-) diff --git a/control_plane/src/compute.rs b/control_plane/src/compute.rs index 2f7c1d66bd..09832905e7 100644 --- a/control_plane/src/compute.rs +++ b/control_plane/src/compute.rs @@ -38,7 +38,7 @@ impl ComputeControlPlane { let pageserver = Arc::new(PageServerNode::from_env(&env)); let pgdatadirspath = &env.pg_data_dirs_path(); - let nodes: Result> = fs::read_dir(pgdatadirspath) + let nodes: Result> = fs::read_dir(&pgdatadirspath) .with_context(|| format!("failed to list {}", pgdatadirspath.display()))? .into_iter() .map(|f| { diff --git a/integration_tests/src/lib.rs b/integration_tests/src/lib.rs index 3ae206ab56..1e17039e4e 100644 --- a/integration_tests/src/lib.rs +++ b/integration_tests/src/lib.rs @@ -202,13 +202,7 @@ impl PostgresNodeExt for PostgresNode { file.read_to_string(&mut buffer).unwrap(); println!("--------------- regression.diffs:\n{}", buffer); } - // self.dump_log_file(); - - if let Ok(mut file) = File::open(self.env.pg_data_dir("main").join("log")) { - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - println!("--------------- pgdatadirs/main/log:\n{}", buffer); - } + self.dump_log_file(); } regress_check } @@ -287,7 +281,7 @@ impl PostgresNodeExt for PostgresNode { println!("Running {}", sql); let result = client.query(sql, &[]); if result.is_err() { - // self.dump_log_file(); + self.dump_log_file(); } result.unwrap() } diff --git a/pageserver/src/branches.rs b/pageserver/src/branches.rs index 19f814be0a..d63dddc678 100644 --- a/pageserver/src/branches.rs +++ b/pageserver/src/branches.rs @@ -31,14 +31,6 @@ pub struct BranchInfo { pub latest_valid_lsn: Option, } -// impl BranchInfo { -// pub fn lsn_string(&self) -> String { -// let lsn_string_opt = self.latest_valid_lsn.map(|lsn| lsn.to_string()); -// let lsn_str = lsn_string_opt.as_deref().unwrap_or("?"); -// format!("{}@{}", self.name, lsn_str) -// } -// } - #[derive(Debug, Clone, Copy)] pub struct PointInTime { pub timelineid: ZTimelineId, @@ -116,14 +108,6 @@ pub fn init_repo(conf: &PageServerConf, repo_dir: &Path) -> Result<()> { fs::write(conf.branch_path("main"), data)?; println!("created main branch"); - // XXX: do we need that now? -- yep, for test only - - // // Also update the system id in the LocalEnv - // local_env.systemid = systemid; - // // write config - // let toml = toml::to_string(&local_env)?; - // fs::write(repopath.join("config"), toml)?; - println!( "new zenith repository was created in {}", repo_dir.display() diff --git a/zenith/Cargo.toml b/zenith/Cargo.toml index eb48af882d..d587a48881 100644 --- a/zenith/Cargo.toml +++ b/zenith/Cargo.toml @@ -10,19 +10,6 @@ edition = "2018" clap = "2.33.0" anyhow = "1.0" serde_json = "1" -# rand = "0.8.3" -# tar = "0.4.33" -# serde = { version = "1.0", features = ["derive"] } -# toml = "0.5" -# lazy_static = "1.4" -# regex = "1" -# # hex = "0.4.3" -# bytes = "1.0.1" -# # fs_extra = "1.2.0" -# nix = "0.20" -# # thiserror = "1" -# url = "2.2.2" - postgres = { git = "https://github.com/zenithdb/rust-postgres.git", rev="9eb0dbfbeb6a6c1b79099b9f7ae4a8c021877858" } # FIXME: 'pageserver' is needed for ZTimelineId. Refactor