Cache storage credentials independently of refresh endpoint - #5231
Open
iting0321 wants to merge 1 commit into
Open
Cache storage credentials independently of refresh endpoint#5231iting0321 wants to merge 1 commit into
iting0321 wants to merge 1 commit into
Conversation
iting0321
force-pushed
the
fix/cache-storage-credentials-independently-of-refresh-endpoint
branch
from
August 3, 2026 09:59
320e3a4 to
e9f8a2f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR changes the storage credential caching behavior so that scoped credentials are cached independently of the per-request refresh credentials endpoint, avoiding duplicate credential-vending calls (e.g., AWS STS AssumeRole) within a single request.
Changes:
- Removes the refresh endpoint from the credential cache identity by always building cache keys without it.
- Attaches provider-specific refresh endpoint metadata to the returned
StorageAccessConfigper response. - Adds an integration test to verify one cache load across varying refresh endpoints and correct endpoint attachment.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| polaris-core/src/main/java/org/apache/polaris/core/storage/CachingStorageIntegration.java | Decouples cache key construction from refresh endpoint and injects refresh endpoint metadata into the response config. |
| polaris-core/src/test/java/org/apache/polaris/core/storage/CachingStorageIntegrationTest.java | Adds coverage to ensure credentials are cached once while refresh endpoints remain request-specific. |
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
Fixes #3292
A single
loadTablerequest can request the same scoped storage credentials twice:FileIO, without a refresh credentials endpoint.Although the underlying credential vending inputs are otherwise identical,
refreshCredentialsEndpointwas part ofStorageCredentialCacheKey. This caused the second lookup to miss the cache and, for AWS storage, resulted in a second STSAssumeRolerequest.Changes
This change treats the refresh endpoint as request specific response metadata rather than credential identity:
refreshCredentialsEndpointfromStorageCredentialCacheKey.StorageAccessConfig.This preserves correct endpoint behavior across requests while allowing identical scoped credentials to reuse one cache entry. It also prevents one request's refresh endpoint from leaking into another response.
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)