From 3ded550272186b2d57ad0e128099148d800a512d Mon Sep 17 00:00:00 2001 From: Stas Kelvich Date: Thu, 22 Apr 2021 11:32:40 +0300 Subject: [PATCH 1/2] Use postgres version with computenode_mode defaulted to false as it has ongoing issues. In a passing also fix test tests on macOS. --- control_plane/src/compute.rs | 1 + control_plane/src/local_env.rs | 6 +++++- control_plane/src/storage.rs | 4 +++- vendor/postgres | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/control_plane/src/compute.rs b/control_plane/src/compute.rs index 0b38af94b1..e63d72ada1 100644 --- a/control_plane/src/compute.rs +++ b/control_plane/src/compute.rs @@ -352,6 +352,7 @@ impl PostgresNode { ) .env_clear() .env("LD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) .status() .with_context(|| "pg_ctl failed")?; if !pg_ctl.success() { diff --git a/control_plane/src/local_env.rs b/control_plane/src/local_env.rs index 10b1b92049..d1809d13f1 100644 --- a/control_plane/src/local_env.rs +++ b/control_plane/src/local_env.rs @@ -140,14 +140,18 @@ pub fn init_repo(local_env: &mut LocalEnv) -> Result<()> { // the repository. Use "tempdir()" or something? Or just create it directly // in the repo? let initdb_path = local_env.pg_bin_dir().join("initdb"); - let _initdb = Command::new(initdb_path) + let initdb = Command::new(initdb_path) .args(&["-D", "tmp"]) .arg("--no-instructions") .env_clear() .env("LD_LIBRARY_PATH", local_env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", local_env.pg_lib_dir().to_str().unwrap()) .stdout(Stdio::null()) .status() .with_context(|| "failed to execute initdb")?; + if !initdb.success() { + anyhow::bail!("pg_ctl failed"); + } println!("initdb succeeded"); // Read control file to extract the LSN and system id diff --git a/control_plane/src/storage.rs b/control_plane/src/storage.rs index c51f047fad..bf7e689be8 100644 --- a/control_plane/src/storage.rs +++ b/control_plane/src/storage.rs @@ -182,7 +182,8 @@ impl PageServerNode { .env("RUST_BACKTRACE", "1") .env("ZENITH_REPO_DIR", self.repo_path()) .env("PATH", self.env.pg_bin_dir().to_str().unwrap()) // needs postres-wal-redo binary - .env("LD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()); + .env("LD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()); if !cmd.status()?.success() { anyhow::bail!( @@ -394,6 +395,7 @@ pub fn regress_check(pg: &PostgresNode) { ]) .env_clear() .env("LD_LIBRARY_PATH", pg.env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", pg.env.pg_lib_dir().to_str().unwrap()) .env("PGHOST", pg.address.ip().to_string()) .env("PGPORT", pg.address.port().to_string()) .env("PGUSER", pg.whoami()) diff --git a/vendor/postgres b/vendor/postgres index 2a9f68e665..610033bb35 160000 --- a/vendor/postgres +++ b/vendor/postgres @@ -1 +1 @@ -Subproject commit 2a9f68e665507420475f2a2fa3d1563dfc5502f3 +Subproject commit 610033bb353e2074e69fb742a43f4828403fe1e1 From bab954b87f2634df7cc2a3a5e04bf2c0d781800d Mon Sep 17 00:00:00 2001 From: Stas Kelvich Date: Thu, 22 Apr 2021 11:45:06 +0300 Subject: [PATCH 2/2] Fix error message wording introduced in previous commit --- control_plane/src/local_env.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control_plane/src/local_env.rs b/control_plane/src/local_env.rs index d1809d13f1..934c45a831 100644 --- a/control_plane/src/local_env.rs +++ b/control_plane/src/local_env.rs @@ -150,7 +150,7 @@ pub fn init_repo(local_env: &mut LocalEnv) -> Result<()> { .status() .with_context(|| "failed to execute initdb")?; if !initdb.success() { - anyhow::bail!("pg_ctl failed"); + anyhow::bail!("initdb failed"); } println!("initdb succeeded");