mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-27 08:09:58 +00:00
Remove forward compatibility hacks related to compute_ctl auth (#11621)
These various hacks were needed for the forward compatibility tests. Enough time has passed since the merge that these are no longer needed. Signed-off-by: Tristan Partin <tristan@neon.tech>
This commit is contained in:
@@ -116,9 +116,7 @@ struct Cli {
|
|||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub set_disk_quota_for_fs: Option<String>,
|
pub set_disk_quota_for_fs: Option<String>,
|
||||||
|
|
||||||
// TODO(tristan957): remove alias after compatibility tests are no longer
|
#[arg(short = 'c', long)]
|
||||||
// an issue
|
|
||||||
#[arg(short = 'c', long, alias = "spec-path")]
|
|
||||||
pub config: Option<OsString>,
|
pub config: Option<OsString>,
|
||||||
|
|
||||||
#[arg(short = 'i', long, group = "compute-id")]
|
#[arg(short = 'i', long, group = "compute-id")]
|
||||||
|
|||||||
@@ -766,10 +766,6 @@ impl Endpoint {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO(tristan957): Remove the write to spec.json after compatibility
|
|
||||||
// tests work themselves out
|
|
||||||
let spec_path = self.endpoint_path().join("spec.json");
|
|
||||||
std::fs::write(spec_path, serde_json::to_string_pretty(&config.spec)?)?;
|
|
||||||
let config_path = self.endpoint_path().join("config.json");
|
let config_path = self.endpoint_path().join("config.json");
|
||||||
std::fs::write(config_path, serde_json::to_string_pretty(&config)?)?;
|
std::fs::write(config_path, serde_json::to_string_pretty(&config)?)?;
|
||||||
|
|
||||||
@@ -779,16 +775,6 @@ impl Endpoint {
|
|||||||
.append(true)
|
.append(true)
|
||||||
.open(self.endpoint_path().join("compute.log"))?;
|
.open(self.endpoint_path().join("compute.log"))?;
|
||||||
|
|
||||||
// TODO(tristan957): Remove when compatibility tests are no longer an
|
|
||||||
// issue
|
|
||||||
let old_compute_ctl = {
|
|
||||||
let mut cmd = Command::new(self.env.neon_distrib_dir.join("compute_ctl"));
|
|
||||||
let help_output = cmd.arg("--help").output()?;
|
|
||||||
let help_output = String::from_utf8_lossy(&help_output.stdout);
|
|
||||||
|
|
||||||
!help_output.contains("--config")
|
|
||||||
};
|
|
||||||
|
|
||||||
// Launch compute_ctl
|
// Launch compute_ctl
|
||||||
let conn_str = self.connstr("cloud_admin", "postgres");
|
let conn_str = self.connstr("cloud_admin", "postgres");
|
||||||
println!("Starting postgres node at '{}'", conn_str);
|
println!("Starting postgres node at '{}'", conn_str);
|
||||||
@@ -807,19 +793,8 @@ impl Endpoint {
|
|||||||
])
|
])
|
||||||
.args(["--pgdata", self.pgdata().to_str().unwrap()])
|
.args(["--pgdata", self.pgdata().to_str().unwrap()])
|
||||||
.args(["--connstr", &conn_str])
|
.args(["--connstr", &conn_str])
|
||||||
// TODO(tristan957): Change this to --config when compatibility tests
|
.arg("--config")
|
||||||
// are no longer an issue
|
.arg(self.endpoint_path().join("config.json").as_os_str())
|
||||||
.args([
|
|
||||||
"--spec-path",
|
|
||||||
self.endpoint_path()
|
|
||||||
.join(if old_compute_ctl {
|
|
||||||
"spec.json"
|
|
||||||
} else {
|
|
||||||
"config.json"
|
|
||||||
})
|
|
||||||
.to_str()
|
|
||||||
.unwrap(),
|
|
||||||
])
|
|
||||||
.args([
|
.args([
|
||||||
"--pgbin",
|
"--pgbin",
|
||||||
self.env
|
self.env
|
||||||
|
|||||||
@@ -81,19 +81,9 @@ sed -i "s/TIMELINE_ID/${timeline_id}/" ${CONFIG_FILE}
|
|||||||
|
|
||||||
cat ${CONFIG_FILE}
|
cat ${CONFIG_FILE}
|
||||||
|
|
||||||
# TODO(tristan957): Remove these workarounds for backwards compatibility after
|
|
||||||
# the next compute release. That includes these next few lines and the
|
|
||||||
# --spec-path in the compute_ctl invocation.
|
|
||||||
if compute_ctl --help | grep --quiet -- '--config'; then
|
|
||||||
SPEC_PATH="$CONFIG_FILE"
|
|
||||||
else
|
|
||||||
jq '.spec' < "$CONFIG_FILE" > /tmp/spec.json
|
|
||||||
SPEC_PATH=/tmp/spec.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Start compute node"
|
echo "Start compute node"
|
||||||
/usr/local/bin/compute_ctl --pgdata /var/db/postgres/compute \
|
/usr/local/bin/compute_ctl --pgdata /var/db/postgres/compute \
|
||||||
-C "postgresql://cloud_admin@localhost:55433/postgres" \
|
-C "postgresql://cloud_admin@localhost:55433/postgres" \
|
||||||
-b /usr/local/bin/postgres \
|
-b /usr/local/bin/postgres \
|
||||||
--compute-id "compute-$RANDOM" \
|
--compute-id "compute-$RANDOM" \
|
||||||
--spec-path "$SPEC_PATH"
|
--config "$CONFIG_FILE"
|
||||||
|
|||||||
Reference in New Issue
Block a user