Skip to content

Commit be7a6c4

Browse files
authored
Merge pull request #13892 from wietzesuijker/perf/multidim-skip-gmac-remote
Multidim: skip .gmac cache stat for non-local filesystems
2 parents e05072c + 75d82ff commit be7a6c4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

autotest/gdrivers/zarr_driver.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6249,7 +6249,6 @@ def test_zarr_read_simple_sharding_network():
62496249
handler.add("HEAD", "/test.zarr/zarr.AUX", 404)
62506250
handler.add("HEAD", "/test.zarr/zarr.json.aux", 404)
62516251
handler.add("HEAD", "/test.zarr/zarr.json.AUX", 404)
6252-
handler.add("HEAD", "/test.zarr/zarr.json.gmac", 404)
62536252
handler.add("HEAD", "/test.zarr/c/0/0", 200, {"Content-Length": "65536"})
62546253
handler.add(
62556254
"GET",

gcore/gdalmultidim.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4362,6 +4362,13 @@ GDALMDArray::GetCacheRootGroup(bool bCanCreate,
43624362
if (pszProxy != nullptr)
43634363
osCacheFilenameOut = pszProxy;
43644364

4365+
// .gmac sidecars are local-only; skip stat for non-local filesystems.
4366+
if (!bCanCreate && pszProxy == nullptr &&
4367+
!VSIIsLocal(osCacheFilenameOut.c_str()))
4368+
{
4369+
return nullptr;
4370+
}
4371+
43654372
std::unique_ptr<GDALDataset> poDS;
43664373
VSIStatBufL sStat;
43674374
if (VSIStatL(osCacheFilenameOut.c_str(), &sStat) == 0)

0 commit comments

Comments
 (0)