From e157b16c24daf3901e7ce480e13894bea600ed10 Mon Sep 17 00:00:00 2001 From: Alek Westover Date: Wed, 9 Aug 2023 14:56:09 -0400 Subject: [PATCH] if control file already exists ignore the remote version of the extension (#4945) --- compute_tools/src/extension_server.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/compute_tools/src/extension_server.rs b/compute_tools/src/extension_server.rs index 6cf4682ff3..da5d519ab5 100644 --- a/compute_tools/src/extension_server.rs +++ b/compute_tools/src/extension_server.rs @@ -169,13 +169,17 @@ pub async fn get_available_extensions( 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)); + if !control_path.exists() { + ext_remote_paths.insert( + extension_name.to_string(), + RemotePath::from_string(&ext_data.archive_path)?, + ); + info!("writing file {:?}{:?}", control_path, control_contents); + file_create_tasks.push(tokio::fs::write(control_path, control_contents)); + } else { + warn!("control file {:?} exists both locally and remotely. ignoring the remote version.", control_file); + } } } let results = join_all(file_create_tasks).await;