From 09dacdacfb1f5b44f182d482a1c2d7eee36af4d5 Mon Sep 17 00:00:00 2001 From: Alek Westover Date: Fri, 28 Jul 2023 09:21:54 -0400 Subject: [PATCH] wip --- compute_tools/src/extension_server.rs | 13 ++++-- .../regress/test_download_extensions.py | 44 +++++++++---------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/compute_tools/src/extension_server.rs b/compute_tools/src/extension_server.rs index 7a36a21100..adf3196cca 100644 --- a/compute_tools/src/extension_server.rs +++ b/compute_tools/src/extension_server.rs @@ -151,19 +151,24 @@ pub async fn get_available_extensions( for extension in enabled_extensions { let ext_data = &all_extension_data[&extension]; for (control_file, control_contents) in &ext_data.control_data { + let extension_name = control_file + .strip_suffix(".control") + .expect("control files must end in .control"); + ext_remote_paths.insert( + extension_name.to_string(), + RemotePath::from_string(&ext_data.archive_path)?, + ); + let control_path = local_sharedir.join(control_file); info!("writing file {:?}{:?}", control_path, control_contents); file_create_tasks.push(tokio::fs::write(control_path, control_contents)); } - ext_remote_paths.insert( - extension.to_string(), - RemotePath::from_string(&ext_data.archive_path)?, - ); } let results = join_all(file_create_tasks).await; for result in results { result?; } + info!("ext_remote_paths {:?}", ext_remote_paths); Ok((ext_remote_paths, library_index)) } diff --git a/test_runner/regress/test_download_extensions.py b/test_runner/regress/test_download_extensions.py index 86c5344862..531c53abc9 100644 --- a/test_runner/regress/test_download_extensions.py +++ b/test_runner/regress/test_download_extensions.py @@ -205,8 +205,8 @@ def test_interrupted_extension( neon_env_builder: NeonEnvBuilder, pg_version: PgVersion, ): - # if "15" in pg_version: # SKIP v15 for now - # return None + if "15" in pg_version: # SKIP v15 for now + return None neon_env_builder.enable_remote_storage( remote_storage_kind=RemoteStorageKind.REAL_S3, @@ -228,32 +228,32 @@ def test_interrupted_extension( ) with closing(endpoint.connect()) as conn: with conn.cursor() as cur: - cur.execute("CREATE EXTENSION 'address_standardizer-3';") + # cur.execute("CREATE EXTENSION address_standardizer;") + cur.execute("CREATE EXTENSION address_standardizer_data_us;") # execute query to ensure that it works cur.execute( "SELECT house_num, name, suftype, city, country, state, unit \ FROM standardize_address('us_lex', 'us_gaz', 'us_rules', \ - 'One Devonshire Place, PH 301, Boston, MA 02109;" + 'One Rust Place, Boston, MA 02109');" ) # the endpoint is closed now # remove postgis files locally cleanup(pg_version) - """ - # spin up compute node again (there are no postgis files available, because compute is stateless) - endpoint = env.endpoints.create_start( - "test_remote_library", - tenant_id=tenant_id, - remote_ext_config=env.ext_remote_storage.to_string(), - ) - # connect to postrgres and execute the query again - with closing(endpoint.connect()) as conn: - with conn.cursor() as cur: - cur.execute("CREATE EXTENSION address_standardizer-3;") - # execute query to ensure that it works - cur.execute( - "SELECT house_num, name, suftype, city, country, state, unit \ - FROM standardize_address('us_lex', 'us_gaz', 'us_rules', \ - 'One Devonshire Place, PH 301, Boston, MA 02109;" - ) - """ + # # spin up compute node again (there are no postgis files available, because compute is stateless) + # endpoint = env.endpoints.create_start( + # "test_remote_library", + # tenant_id=tenant_id, + # remote_ext_config=env.ext_remote_storage.to_string(), + # ) + # # connect to postrgres and execute the query again + # with closing(endpoint.connect()) as conn: + # with conn.cursor() as cur: + # cur.execute("CREATE EXTENSION address_standardizer;") + # cur.execute("CREATE EXTENSION address_standardizer_data_us;") + # # execute query to ensure that it works + # cur.execute( + # "SELECT house_num, name, suftype, city, country, state, unit \ + # FROM standardize_address('us_lex', 'us_gaz', 'us_rules', \ + # 'One Rust Place, Boston, MA 02109');" + # )