Repository navigation
IRC: Optimize Credential Vending - #3997
Conversation
eb5db50 to
f802657
Compare
| * full table metadata read from object storage. Falls back to the standard | ||
| * loadTableWithAccessDelegation path if the entity lacks the required properties. | ||
| */ | ||
| public ImmutableLoadCredentialsResponse loadCredentialsFromEntityProperties( |
There was a problem hiding this comment.
Do we need to also check the validateRemoteTableLocations when reading from props?
This seems important since the allowed locations can occur outside of a table write where the location is currently checked.
There was a problem hiding this comment.
I wonder if we should even allow RemoteCatalog aka External Catalogs ? external writes can happen independently of the external catalog without going through Polaris and our entities might not be consistent ?
I added a check for now to only do this for catlaog owned by Polaris
dimas-b
left a comment
There was a problem hiding this comment.
Sorry about the delay, @singhpk234 , I think I stated reviewing this PR a while back, but got distracted 😅
Adding some minor comments, but I think @travis-bowen raised some good points.
dimas-b
left a comment
There was a problem hiding this comment.
LGTM overall, I'll make another pass tomorrow
|
Thanks a lot for adding this, @singhpk234! I think it will skip the IO for the credential endpoint, which saves a lot, in terms of cost and time. Great idea! |
flyrain
left a comment
There was a problem hiding this comment.
LGTM overall. Only one question here, https://github.com/apache/polaris/pull/3997/changes#r3005444826.
|
@singhpk234 : please update PR description to match the latest state of the code :) |
dimas-b
left a comment
There was a problem hiding this comment.
Sorry, one more last minute comment 😅
Add an OPTIMIZED_CREDENTIAL_VENDING feature flag that allows the loadCredentials endpoint to vend storage credentials using location data stored in entity internal properties, bypassing the expensive full table metadata read from object storage. When the flag is enabled, the new loadCredentialsFromEntityProperties path resolves the table's base and data locations directly from the metastore and uses them to scope credentials. If the entity or its location data is missing (e.g. external catalogs or pre-apache#3226 data), it falls back transparently to the standard loadTableWithAccessDelegation path.
- Add authz test for loadCredentialsFromEntityProperties verifying TABLE_READ_DATA and TABLE_WRITE_DATA privileges - Add integration tests for /loadCredentials endpoint with optimized credential vending both enabled and disabled - Add loadCredentials helper method to CatalogApi - Remove Javadoc from private vendCredentials method
…talogs, add negative authz tests Remove the OPTIMIZED_CREDENTIAL_VENDING feature flag since the optimized path already has robust fallback to the standard loadTable path. The adapter now unconditionally calls loadCredentialsFromEntityProperties which handles all edge cases internally. Add an explicit guard to restrict optimized credential vending to native Polaris catalogs only, since federated/external catalogs are passthrough and their entity internal properties may not be in sync with the remote catalog's actual table metadata. Add negative authorization test cases to verify that TABLE_READ_PROPERTIES and TABLE_WRITE_PROPERTIES are insufficient for credential vending.
Move the native catalog guard after authorizeLoadTable() since baseCatalog is lazily initialized during authorization. Add two tests: one verifying the optimized path never calls loadTable (no FileIO), and one verifying non-IcebergCatalog triggers the fallback path.
…l fast on missing entity Address flyrain's review feedback: - Rename method since it can fall back to table metadata.json - Throw NoSuchTableException instead of falling back when entity is not found in the metastore
…dentials When vendCredentials returns null, use an empty StorageAccessConfig instead of returning an empty response. This ensures the supportsCredentialVending validation check runs on all code paths, preventing silent masking of configuration errors.
058a695 to
15bc7ef
Compare
…alogFactory Update test references to use renamed LocalCatalogFactory interface and createCatalog method after upstream rename.
Fix method parameters that got skewed due to overlapped merges of apache#3750 and apache#3997
About the change
The /credentials endpoint currently performs a full table metadata read from object storage to vend credentials.
This is expensive and unnecessary — the table locations needed for credential vending are already available in the
entity's internal properties stored in the metastore.
This PR introduces an optimized credential vending path via loadCredentials that reads locations directly from the
metastore, avoiding the object storage round-trip. When the entity lacks the required internal properties (e.g. tables
created before the property was stored), it gracefully falls back to the existing loadTableWithAccessDelegation path.
The optimization is restricted to native Polaris catalogs only — federated/external catalogs fall back to the standard
path since their entity internal properties may not be in sync with the remote catalog's actual table metadata.
Key changes:
co-author : @adutra
Checklist
CHANGELOG.md(if needed) --latersite/content/in-dev/unreleased(if needed)