From 13d3a62705e6a7aa2b8020ba7f3009745e8665b9 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Thu, 25 Sep 2025 20:49:40 +0200 Subject: [PATCH] Clean also global_metadata_cache on discovering a URL is now changed --- src/httpfs.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/httpfs.cpp b/src/httpfs.cpp index 0fc5a24..802581e 100644 --- a/src/httpfs.cpp +++ b/src/httpfs.cpp @@ -266,13 +266,19 @@ unique_ptr HTTPFileSystem::GetRangeRequest(FileHandle &handle, str string responseEtag = response.GetHeaderValue("ETag"); if (!responseEtag.empty() && responseEtag != hfh.etag) { + if (global_metadata_cache) { + global_metadata_cache->Erase(handle.path); + } throw HTTPException( response, - "ETag was initially %s and now it returned %s, this likely means the remote file has " - "changed.\nTry to restart the read or close the file-handle and read the file again (e.g. " - "`DETACH` in the file is a database file).\nYou can disable checking etags via `SET " + "ETag on reading file \"%s\" was initially %s and now it returned %s, this likely means " + "the " + "remote file has " + "changed.\nFor parquet or similar single table sources, consider retrying the query, for " + "persistent FileHandles such as databases consider `DETACH` and re-`ATTACH` " + "\nYou can disable checking etags via `SET " "unsafe_disable_etag_checks = true;`", - hfh.etag, response.GetHeaderValue("ETag")); + handle.path, hfh.etag, response.GetHeaderValue("ETag")); } }