{{ message }}
Cherry pick #107480 to 26.3: DeltaLake: replace cached snapshot on update() so kernel sees fresh creds#108110
Merged
robot-ch-test-poll merged 18 commits intoJun 25, 2026
Merged
Conversation
…reds The fresh snapshot rebuilt inside `update()` already captures the C++ S3 client's current creds via `createBuilder` keep it instead of discarding it when the version matches, so the next kernel op runs on a freshly-credentialed engine and doesn't outlive the STS TTL.
Compare a SipHash128 of the C++ S3 client's current credentials against the one captured when kernel_snapshot_state was built, and rebuild only the kernel engine + snapshot + scan when they differ. Schema, stats, and the snapshot LRU cache are preserved across rebuilds.
The previous wording change broke test_database_delta::test_complex_table_schema's contains_in_log assertion. Split the init and rebuild branches so the init path emits the original message verbatim.
Vended catalog credentials (Glue / Unity / REST) are static in the C++
S3 client until `credentials_refresh_callback` fires, but delta-kernel's
Rust object_store bypasses the ClickHouse error handlers that normally
invoke it. So an expired vended session surfaces as `DELTA_KERNEL_ERROR`
with `ExpiredToken` and never recovers.
Plumb the callback through `IObjectStorage::tryRefreshCredentialsViaCallback`
to `IKernelHelper::refreshCredentials`, and add a one-shot retry on
stale-token errors at both kernel touchpoints:
- `TableSnapshot::initOrUpdateSnapshot` (engine build)
- `Iterator::scanDataFunc` (per-batch listing, guarded by
`total_data_files == 0` so we don't replay already-emitted paths)
…ider SetNeedRefresh() was a no-op for STS-assumed-role; align with WebIdentity/SSO behavior in the same file.
On failure leave m_needsRefresh and cached credentials in place so the next GetAWSCredentials retries STS instead of handing back the S3-rejected session.
Two failpoints to exercise the retry path without a real catalog:
- `delta_kernel_force_stale_token_error` (ONCE) throws DELTA_KERNEL_ERROR
with `ExpiredToken` in the message from `KernelSnapshotState`.
- `object_storage_force_refresh_callback_success` short-circuits
`S3ObjectStorage::tryRefreshCredentialsViaCallback` to succeed without
needing a Glue / Unity / REST catalog wired in.
Combined with `delta_kernel_force_credentials_fingerprint_drift` to force
the rebuild branch in `initOrUpdateSnapshot`, the test asserts the
"refreshed via catalog callback and retrying" log line fires and the
query still returns the correct row count.
Forwards to the same shape as `getS3StorageClient` / `tryGetS3StorageClient`.
…date DeltaLake: replace cached snapshot on update() so kernel sees fresh creds
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Original pull-request #107480
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job