Repository navigation
Enable bucket-region cache per catalogs - #113330
Conversation
|
Workflow [PR], commit [5ee19da] Summary: ✅
AI ReviewSummaryThis PR makes Findings❌ Blockers
Tests
Final VerdictStatus:
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 16/24 (66.67%) · Uncovered code |
|
Demo: |
| @@ -92,7 +92,7 @@ class ClientCacheRegistry | |||
| std::mutex clients_mutex; | |||
| UnorderedMapWithMemoryTracking<ClientCache *, std::pair<std::weak_ptr<ClientCache>, size_t>> client_caches TSA_GUARDED_BY(clients_mutex); | |||
There was a problem hiding this comment.
Persisting std::shared_ptr<ClientCache> here makes the whole ClientCache cross-client, not just the bucket-region map. ClientCache also carries uri_for_bucket_cache (src/IO/S3/Client.h:66-67), and those redirect URIs are only checked against remote_host_filter when they are first learned (src/IO/S3/Client.cpp:1065-1069 / src/IO/S3/PocoHTTPClient.cpp:681-685). Later clients reuse getURIForBucket directly (src/IO/S3/Client.cpp:1086-1090) with no revalidation.
That becomes a real boundary change because the registry key is only (endpoint, bucket), while different callers build clients with different host filters. For example KeeperSnapshotManagerS3 uses RemoteHostFilter() (src/Coordination/KeeperSnapshotManagerS3.cpp:117-120, which allows all hosts by default), while user-facing paths such as GlueCatalog use getContext()->getRemoteHostFilter() (src/Databases/DataLake/GlueCatalog.cpp:152-155). After this change, a redirect URI accepted under the permissive client can survive past its lifetime and be replayed later by the stricter client, bypassing the second client's host-filter check. Please either keep only the region cache alive across dead clients, or revalidate cached URI overrides against the current client's remote_host_filter before every reuse.
Avogar
left a comment
There was a problem hiding this comment.
Loogs good, just a few minor comments
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units64 translation units recompiled, 585 s compile time in total, 64 of them have a recent master baseline. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
There is bucket-region cache in S3 Client. However, it didn't work for data lake catalogs. This PR fixes such behaviour
Workflow [PR]
Sync PR [sync-upstream/pr/113330]
Version info
26.8.1.1858(included in26.8and later)