removing debugging

This commit is contained in:
Alek Westover
2023-06-21 10:51:35 -04:00
parent bb414e5a0a
commit 8b9f72e117
4 changed files with 44 additions and 49 deletions

View File

@@ -1 +0,0 @@
[RemotePath("tenants/1fa068222e7cc9113a7d790ef4921ac2/timelines/f0895167297fb57d8beff3c89deb4b41/000000000000000000000000000000000000-FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF__000000000169B098-000000000169B111"), RemotePath("tenants/1fa068222e7cc9113a7d790ef4921ac2/timelines/f0895167297fb57d8beff3c89deb4b41/index_part.json"), RemotePath("tenants/60f5b0fed2e13576f36abf833475d2f9/timelines/109292e9aa6241fd0a8efa0bc3daea22/000000000000000000000000000000000000-FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF__000000000169B098-000000000169B111"), RemotePath("tenants/60f5b0fed2e13576f36abf833475d2f9/timelines/109292e9aa6241fd0a8efa0bc3daea22/index_part.json"), RemotePath("tenants/60f5b0fed2e13576f36abf833475d2f9/timelines/784c71b4e09a0f52d1e8f401347caee9/000000000000000000000000000000000000-FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF__000000000169B098-000000000169B111"), RemotePath("tenants/60f5b0fed2e13576f36abf833475d2f9/timelines/784c71b4e09a0f52d1e8f401347caee9/index_part.json"), RemotePath("v15/share/extension/test_ext.control")]

View File

@@ -163,57 +163,58 @@ async fn routes(req: Request<Body>, compute: &Arc<ComputeNode>) -> Response<Body
}
}
//debug only
async fn download_file(filename: &str) -> anyhow::Result<()> {
info!("requested file {}", filename);
// TODO: delete this function
// // debug only
// async fn download_file(filename: &str) -> anyhow::Result<()> {
// info!("requested file {}", filename);
let from_prefix: &str = "/tmp"; //debug only
let to_prefix = "/home/anastasia/work/neon/pg_install/v15/";
// let from_prefix: &str = "/tmp"; //debug only
// let to_prefix = "/home/anastasia/work/neon/pg_install/v15/";
if filename.ends_with(".so") {
info!("requested file is a shared object file {}", filename);
// if filename.ends_with(".so") {
// info!("requested file is a shared object file {}", filename);
let from_path = Path::new(from_prefix).join("lib").join(filename);
let to_path = Path::new(to_prefix).join("lib/postgresql/").join(filename);
// let from_path = Path::new(from_prefix).join("lib").join(filename);
// let to_path = Path::new(to_prefix).join("lib/postgresql/").join(filename);
info!(
"copying file {} from {} to {}",
filename,
from_path.display(),
to_path.display()
);
// info!(
// "copying file {} from {} to {}",
// filename,
// from_path.display(),
// to_path.display()
// );
fs::copy(from_path, to_path)?;
} else {
info!("requested all extension files with prefix {}", filename);
// fs::copy(from_path, to_path)?;
// } else {
// info!("requested all extension files with prefix {}", filename);
let from_path = Path::new(from_prefix).join("share/extension/");
let to_path = Path::new(to_prefix).join("share/postgresql/extension/");
// let from_path = Path::new(from_prefix).join("share/extension/");
// let to_path = Path::new(to_prefix).join("share/postgresql/extension/");
info!(
"copying files from {} to {}",
from_path.display(),
to_path.display()
);
// info!(
// "copying files from {} to {}",
// from_path.display(),
// to_path.display()
// );
for file in fs::read_dir(from_path.clone()).unwrap().flatten() {
let fname = file.file_name().into_string().unwrap();
// for file in fs::read_dir(from_path.clone()).unwrap().flatten() {
// let fname = file.file_name().into_string().unwrap();
if fname.starts_with(filename) && fname.ends_with(".sql") {
info!(
"copying file {} from {} to {}",
fname,
from_path.display(),
to_path.display()
);
// if fname.starts_with(filename) && fname.ends_with(".sql") {
// info!(
// "copying file {} from {} to {}",
// fname,
// from_path.display(),
// to_path.display()
// );
fs::copy(file.path(), to_path.join(fname))?;
}
}
}
// fs::copy(file.path(), to_path.join(fname))?;
// }
// }
// }
Ok(())
}
// Ok(())
// }
async fn handle_configure_request(
req: Request<Body>,

View File

@@ -418,9 +418,6 @@ impl Endpoint {
anyhow::bail!("The endpoint is already running");
}
// ALEK: this is it
// How to tet remote-ext-config into here?
// Slurp the endpoints/<endpoint id>/postgresql.conf file into
// memory. We will include it in the spec file that we pass to
// `compute_ctl`, and `compute_ctl` will write it to the postgresql.conf
@@ -496,10 +493,8 @@ impl Endpoint {
// Launch compute_ctl
println!("Starting postgres node at '{}'", self.connstr());
println!("alek REMOTESTORAGE logfile {:?}", logfile);
let mut cmd = Command::new(self.env.neon_distrib_dir.join("compute_ctl"));
// TODO: alek right here
cmd.args(["--http-port", &self.http_address.port().to_string()])
.args(["--remote-ext-config", remote_ext_config])
.args(["--pgdata", self.pgdata().to_str().unwrap()])

View File

@@ -115,9 +115,9 @@ pub(super) mod metrics {
/// AWS S3 storage.
pub struct S3Bucket {
pub client: Client,
pub bucket_name: String, // TODO: undo making these public
pub prefix_in_bucket: Option<String>,
client: Client,
bucket_name: String,
prefix_in_bucket: Option<String>,
max_keys_per_list_response: Option<i32>,
// Every request to S3 can be throttled or cancelled, if a certain number of requests per second is exceeded.
// Same goes to IAM, which is queried before every S3 request, if enabled. IAM has even lower RPS threshold.