Skip to content

feat(query): extend S3 credential refresher to all expiring sources (#601) - #604

Merged
xe-nvdk merged 1 commit into
mainfrom
feat/601-canexpire-refresher
Aug 18, 2026
Merged

xe-nvdk merged 1 commit into
mainfrom
feat/601-canexpire-refresher

Conversation

@xe-nvdk

@xe-nvdk xe-nvdk commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

Test plan

  • 33/33 packages (-tags=duckdb_arrow), -race clean
  • Adversarial plan validation + single deep reviewer; all findings fixed (incl. H1 cache-config regression, verified at a NON-default query.enable_s3_cache=true)
  • Regression tests revert-verified (gate deletion, fallback, sentinel routing); severity choreography (Error×3 → one Warn → Debug; Debug→Warn escalation) pinned via buffer-logger test
  • Hermetic AWS env in every test reaching the SDK chain (no ambient-credential leaks, no IMDS probes in CI)
  • Binary runs: local, keyless+nothing (fallback + escape-hatch Warn, no startup failure), keyless+profile (emit-once, sanitized source)
  • Live gate (real AWS STS, ~70min): Pod-Identity-shaped credential endpoint with deliberately LATE rotation — proactive fire → 2 Warn polls → rotation pickup within 1min → queries green past the old session's real expiry. VERDICT: query=OK refreshes=2 polls=2 errors=0
  • Residual documented: real IMDS rotation lead untested (flat 1min poll tolerates any lead ≥1min); Pod Identity verified via env-token variant of the same SDK provider

Matching docs: docs.basekick.net branch docs/601-all-sources-refreshed.

🤖 Generated with Claude Code

…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
@xe-nvdk
xe-nvdk merged commit 9a99773 into main Aug 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend #600 credential refresher to all expiring credential sources (instance roles, Pod Identity) via a CanExpire gate

1 participant