Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/httpfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,19 @@ unique_ptr<HTTPResponse> 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"));
}
}

Expand Down
Loading