mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 17:02:56 +00:00
removing debugging
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -18,5 +18,3 @@ test_output/
|
||||
*.o
|
||||
*.so
|
||||
*.Po
|
||||
|
||||
alek/
|
||||
|
||||
1
ALEK_LIST_FILES.txt
Normal file
1
ALEK_LIST_FILES.txt
Normal file
@@ -0,0 +1 @@
|
||||
[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")]
|
||||
@@ -60,9 +60,6 @@ use tokio::runtime::Runtime;
|
||||
fn main() -> Result<()> {
|
||||
init_tracing_and_logging(DEFAULT_LOG_LEVEL)?;
|
||||
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
std::fs::write("alek/ARG", args.join(" "))?;
|
||||
|
||||
let matches = cli().get_matches();
|
||||
|
||||
let remote_ext_config = matches
|
||||
@@ -81,8 +78,6 @@ fn main() -> Result<()> {
|
||||
Value::String(x) => x,
|
||||
_ => panic!("oops"),
|
||||
};
|
||||
warn!("you certainly must build changes if you want rust changes to be built");
|
||||
std::fs::write("alek/yay", remote_ext_bucket.clone())?;
|
||||
|
||||
let rt = Runtime::new().unwrap();
|
||||
rt.block_on(async move {
|
||||
@@ -213,7 +208,7 @@ fn main() -> Result<()> {
|
||||
live_config_allowed,
|
||||
state: Mutex::new(new_state),
|
||||
state_changed: Condvar::new(),
|
||||
remote_ext_bucket: remote_ext_bucket.clone(), // TODO ALEK: pass all the args!
|
||||
remote_ext_bucket: remote_ext_bucket.clone(), // TODO: pass more configurations?
|
||||
remote_ext_region: remote_ext_region.clone(),
|
||||
remote_ext_endpoint: remote_ext_endpoint.clone(),
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ pub struct ComputeNode {
|
||||
/// `Condvar` to allow notifying waiters about state changes.
|
||||
pub state_changed: Condvar,
|
||||
// S3 configuration variables:
|
||||
// TODO: alek pass all args here
|
||||
// TODO: pass more args here?
|
||||
pub remote_ext_bucket: String,
|
||||
pub remote_ext_region: String,
|
||||
pub remote_ext_endpoint: String,
|
||||
|
||||
@@ -137,7 +137,7 @@ async fn routes(req: Request<Body>, compute: &Arc<ComputeNode>) -> Response<Body
|
||||
|
||||
match extension_server::download_file(
|
||||
filename,
|
||||
// TODO alek: pass more remote_ext arguments
|
||||
// TODO: pass more remote_ext arguments?
|
||||
compute.remote_ext_bucket.clone(),
|
||||
compute.remote_ext_region.clone(),
|
||||
compute.remote_ext_endpoint.clone(),
|
||||
@@ -344,10 +344,6 @@ async fn serve(port: u16, state: Arc<ComputeNode>) {
|
||||
pub fn launch_http_server(port: u16, state: &Arc<ComputeNode>) -> Result<thread::JoinHandle<()>> {
|
||||
let state = Arc::clone(state);
|
||||
|
||||
// TODO: remote print statements
|
||||
let xxx = format!("ROUTING port: {port}");
|
||||
std::fs::write("alek/ROUTES", xxx).expect("routing write file");
|
||||
|
||||
Ok(thread::Builder::new()
|
||||
.name("http-endpoint".into())
|
||||
.spawn(move || serve(port, state))?)
|
||||
|
||||
@@ -28,7 +28,6 @@ use std::path::PathBuf;
|
||||
use std::process::exit;
|
||||
use std::str::FromStr;
|
||||
use storage_broker::DEFAULT_LISTEN_ADDR as DEFAULT_BROKER_ADDR;
|
||||
// use tracing::{error, info, warn};
|
||||
use utils::{
|
||||
auth::{Claims, Scope},
|
||||
id::{NodeId, TenantId, TenantTimelineId, TimelineId},
|
||||
@@ -692,7 +691,6 @@ fn handle_endpoint(ep_match: &ArgMatches, env: &local_env::LocalEnv) -> Result<(
|
||||
.copied()
|
||||
.unwrap_or(false);
|
||||
|
||||
// TODO alek maybe this is the place to pass args
|
||||
if let Some(endpoint) = endpoint {
|
||||
match (&endpoint.mode, hot_standby) {
|
||||
(ComputeMode::Static(_), true) => {
|
||||
@@ -748,7 +746,6 @@ fn handle_endpoint(ep_match: &ArgMatches, env: &local_env::LocalEnv) -> Result<(
|
||||
pg_version,
|
||||
mode,
|
||||
)?;
|
||||
// TODO: alek this is where the endpoint is created / started
|
||||
ep.start(&auth_token, safekeepers, &remote_ext_config)?;
|
||||
}
|
||||
}
|
||||
|
||||
5
test_ext.control
Normal file
5
test_ext.control
Normal file
@@ -0,0 +1,5 @@
|
||||
# mock extension
|
||||
comment = 'This is a mock extension'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/test_ext'
|
||||
relocatable = true
|
||||
@@ -38,9 +38,6 @@ def test_file_download(neon_env_builder: NeonEnvBuilder):
|
||||
neon_env_builder.num_safekeepers = 3
|
||||
env = neon_env_builder.init_start()
|
||||
|
||||
with open("alek/env.txt", "w") as f:
|
||||
f.write(str(env.__dict__))
|
||||
|
||||
TEST_EXT_PATH = "v15/share/extension/test_ext.control"
|
||||
|
||||
# TODO: we shouldn't be using neon_env_builder.remote_storage_client,
|
||||
@@ -48,7 +45,7 @@ def test_file_download(neon_env_builder: NeonEnvBuilder):
|
||||
|
||||
# 4. Upload test_ext.control file to the bucket
|
||||
# In the non-mock version this is done by CI/CD
|
||||
with open("alek/test_ext.control", "rb") as data:
|
||||
with open("test_ext.control", "rb") as data:
|
||||
neon_env_builder.remote_storage_client.upload_fileobj(
|
||||
data, neon_env_builder.remote_storage.bucket_name, TEST_EXT_PATH
|
||||
)
|
||||
@@ -101,8 +98,6 @@ def test_file_download(neon_env_builder: NeonEnvBuilder):
|
||||
# the real test query: check that test_ext is present
|
||||
cur.execute("SELECT * FROM pg_available_extensions")
|
||||
all_extensions = [x[0] for x in cur.fetchall()]
|
||||
with open("alek/win.txt", "w") as f:
|
||||
f.write(str(all_extensions))
|
||||
log.info(all_extensions)
|
||||
assert "test_ext" in all_extensions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user