Repository navigation
feat(query): extend S3 credential refresher to all expiring sources (#601) - #604
Merged
Merged
Conversation
…601) Widens the #600 refresher from IRSA-only env-sniffing to resolve-and- decide: with no static keys configured, Arc builds the same SDK credential chain ingest uses and routes on the result. Expiring credentials — IRSA, EC2 instance roles, EKS Pod Identity, SSO, process creds — get the managed refresher; non-expiring ones (env/profile keys) are emitted once; an unresolvable chain falls back to a plain CREDENTIAL_CHAIN secret while a demoted background retry keeps probing. Query identity now equals ingest identity by construction. Notable semantics, all live- or stub-verified: - Non-advancing resolves are no longer errors: IMDS and the Pod Identity agent rotate server-side on their own schedule, so the refresher polls at a flat 1min (Debug, Warn inside the final 5min) until the source rotates. Verified live: a deliberately late-rotated credential endpoint (real STS sessions) produced 2 Warn polls, clean pickup, and queries healthy past the old session's real expiry. - ec2rolecreds caps reported expiry at now+1h, so hourly re-emits on EC2 are expected; endpointcreds carries a baked-in 5min ExpiryWindow. Both pinned by stub tests driving the real provider chain (AWS_EC2_METADATA_SERVICE_ENDPOINT / AWS_CONTAINER_CREDENTIALS_FULL_URI). - The chain fallback needs VALIDATION 'none': DuckDB validates chain secrets at CREATE and fails when nothing resolves — which made a truly credential-less S3 deployment STARTUP-FATAL on 26.09.1-as-was (masked on dev machines by ~/.aws/credentials). It now starts on the fallback, logs one Warn naming AWS_EC2_METADATA_DISABLED (the <1ms escape hatch for the measured 4-5s IMDS probe), and self-heals if credentials appear later. - Secret-template errors stay startup-fatal; only credential resolution degrades. Fallback emission is ordered structurally before the retry loop (pre-loop hook), and stop-old-before-start-new prevents a replaced refresher from clobbering its successor. - prefetch_all_parquet_files and the cache_httpfs configuration now apply to ALL keyless deployments — the deferred-secret early return was silently skipping them (found in review; inherited by the #600 IRSA path too, fixed for both). - credential_mode log values are now static_keys / sdk_managed / credential_chain, with the concrete provider source (EC2RoleProvider, WebIdentityCredentials, CredentialsEndpointProvider, SharedConfigCredentials — path-sanitized) logged per emission. Closes #601
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.
Summary
CREDENTIAL_CHAINsecret with a demoted background retry. Query identity ≡ ingest identity by construction.~/.aws); now starts on aVALIDATION 'none'fallback with one Warn namingAWS_EC2_METADATA_DISABLED(skips the measured 4–5s IMDS probe). Also: the deferred-secret early-return silently skippedprefetch_all_parquet_files+ allcache_httpfsconfig for keyless deployments (inherited by merged IRSA: DuckDB query path fails with ExpiredToken ~1h after start (credential_chain never refreshes) #600 too) — fixed for both.Test plan
-tags=duckdb_arrow),-racecleanquery.enable_s3_cache=true)VERDICT: query=OK refreshes=2 polls=2 errors=0Matching docs:
docs.basekick.netbranchdocs/601-all-sources-refreshed.🤖 Generated with Claude Code