Skip to content

Cache vended credentials for REST catalogs - #107960

Open
zvonand wants to merge 24 commits into
ClickHouse:masterfrom
zvonand:zvonand/cache-vended-creds
Open

zvonand wants to merge 24 commits into
ClickHouse:masterfrom
zvonand:zvonand/cache-vended-creds

Conversation

@zvonand

@zvonand zvonand commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Now, new vended credentials are requested on each metadata request. This PR adds an (optional) cache for creds with configurable TTL.

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Add option to cache vended credentials for REST catalogs; add a setting vended_credentials_cache_ttl (seconds). 300 by default. 0 means no caching.


Workflow [PR]
Sync PR [sync-upstream/pr/107960]

@fm4v fm4v added the can be tested Allows running workflows for external contributors label Jun 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f4949e5]

Summary: ❌

job_name test_name status info comment
Build (arm_tidy, 1/4) FAIL
Build ClickHouse FAIL cidb
Build (arm_tidy, 2/4) FAIL
Build ClickHouse FAIL cidb
Build (arm_tidy, 3/4) FAIL
Build ClickHouse FAIL cidb
Build (arm_tidy, 4/4) FAIL
Build ClickHouse FAIL cidb
Fast test (arm_darwin) DROPPED
Build (amd_debug) DROPPED
Build (amd_asan_ubsan) DROPPED
Build (amd_tsan) DROPPED
Build (amd_msan) DROPPED
Build (amd_binary) DROPPED

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Jun 19, 2026
Comment thread src/Databases/DataLake/RestCatalog.cpp Resolved
Comment thread src/Databases/DataLake/RestCatalog.cpp Resolved
@zvonand
zvonand force-pushed the zvonand/cache-vended-creds branch 2 times, most recently from e9b0fce to eb00a91 Compare June 25, 2026 10:11
Comment thread src/Databases/DataLake/RestCatalog.cpp Resolved
@zvonand
zvonand force-pushed the zvonand/cache-vended-creds branch from f2015e3 to 3908fef Compare June 29, 2026 08:02
Comment thread src/Databases/DataLake/RestCatalog.cpp Resolved
Comment thread src/Databases/DataLake/RestCatalog.cpp Resolved
Comment thread src/Databases/DataLake/RestCatalog.cpp Resolved
@zvonand
zvonand force-pushed the zvonand/cache-vended-creds branch from b4f7efc to 8e1a1d4 Compare July 30, 2026 12:03
Comment thread src/Databases/DataLake/RestCatalog.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.50% 86.40% -0.10%
Functions 91.90% 91.80% -0.10%
Branches 78.60% 78.50% -0.10%

Changed lines: Changed C/C++ lines covered: 299/598 (50.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh

clickhouse-gh Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing ab8a3e9aa with master bdbd1b837 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of b02fbee24; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

28 object files changed (+297.89 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Databases/DataLake/RestCatalog.cpp.o 1.18 MiB 1.25 MiB +70.03 KiB (+5.81%)
src/CMakeFiles/dbms.dir/Disks/DiskObjectStorage/ObjectStorages/AzureBlobStorage/AzureObjectStorage.… 441.48 KiB 496.76 KiB +55.28 KiB (+12.52%)
src/CMakeFiles/clickhouse_common_io.dir/Disks/DiskObjectStorage/ObjectStorages/AzureBlobStorage/Azu… 441.48 KiB 496.76 KiB +55.28 KiB (+12.52%)
src/CMakeFiles/dbms.dir/Storages/ObjectStorage/Azure/Configuration.cpp.o 551.55 KiB 581.87 KiB +30.32 KiB (+5.50%)
src/CMakeFiles/dbms.dir/Disks/IO/WriteBufferFromAzureDataLakeStorage.cpp.o 269.18 KiB 293.74 KiB +24.56 KiB (+9.12%)
src/CMakeFiles/dbms.dir/Disks/IO/ReadBufferFromAzureBlobStorage.cpp.o 274.36 KiB 291.25 KiB +16.89 KiB (+6.15%)

719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

148 translation units recompiled, 1298 s compile time in total, 148 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×0.95 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost -78.5 s (-6%) in total before that adjustment.

Symbol sizes
Binary Symbol Master PR Δ
programs/clickhouse ProfileEvents::global_counters_storage 14.25 MiB 14.31 MiB +64.00 KiB (+0.44%)
programs/clickhouse-keeper ProfileEvents::global_counters_storage 14.25 MiB 14.31 MiB +64.00 KiB (+0.44%)

Job report

@abashkeev abashkeev added the comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. label Sep 4, 2026
@zvonand
zvonand force-pushed the zvonand/cache-vended-creds branch from 184a3da to 9c58f4f Compare September 10, 2026 09:54
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Sep 28, 2026
Cherry-pick of ClickHouse#107960

Add an optional cache for vended credentials of REST data lake catalogs,
controlled by the new `DataLakeCatalog` database setting
`vended_credentials_cache_ttl` (seconds, default `300`, `0` disables caching).
Azure read/write buffers, listing, delete paths and metadata probes refresh
credentials through the catalog callback once on an authentication error.

Adapted to antalya-26.8:
* `ICatalog::getCredentialsConfigurationCallback` has no `table_metadata`
  parameter here: `RestCatalog` checks the table identity against
  `storage_id.uuid`, and `UnityCatalog` picks Azure or S3 credentials by the
  content of the credentials response.
* `UnityV2Catalog` does not exist here, so its hunk is skipped.
* `ReadBufferFromAzureBlobStorage` keeps the existing `blob_client` member
  instead of the upstream lazy `getBlobClient` accessor; `checkReturnedRange`
  does not exist here.
* `AzureObjectStorage` keeps plain `connection_params` and `auth_method`; there
  is no `cloneImpl` or `successful_objects` out-parameter here.
`DeltaLakeMetadataDeltaKernel::write` requests `READ_WRITE` credentials only when
`hasCredentialsRefreshCallback` is true, so Azure-backed Unity tables kept writing with
the `READ` token. Mirror `S3ObjectStorage`: rebuild the container client from the
refreshed `ConnectionParams` and publish them together with the client.
Comment thread src/Databases/DataLake/UnityCatalog.cpp Resolved
Comment thread src/Databases/DataLake/RestCatalog.cpp Resolved
@maxknv maxknv added the external Author is not a member of the ClickHouse organization label Nov 2, 2026
Comment thread src/Databases/DataLake/RestCatalog.cpp Resolved
@clickhouse-gh clickhouse-gh Bot added comp-datalake-catalogs Data lake catalogs: the DataLakeCatalog database engine and its catalog clients - Iceberg REST, A... and removed comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. labels Nov 19, 2026
@alexey-milovidov alexey-milovidov self-assigned this Nov 22, 2026
# Conflicts:
#	src/Databases/DataLake/RestCatalog.cpp
#	src/Databases/DataLake/StorageCredentials.h
#	src/Databases/DataLake/UnityCatalog.cpp
#	src/Databases/DataLake/UnityV2Catalog.cpp

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-datalake-catalogs Data lake catalogs: the DataLakeCatalog database engine and its catalog clients - Iceberg REST, A... external Author is not a member of the ClickHouse organization manual approve Manual approve required to run CI pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants