Hi all,
Thanks Yufei and JB for the feedback. +1 for the plan to define the
expected update semantics per field before adding any new checks.

Proposed next steps:
1. Write a short spec listing each storage config field, whether it can
change after creation, and the impact of changing it (identity/tenant
boundary vs. operational setting).
2. Align ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES with the tested
behavior. The flag doc should say cross-account changes (awsAccountId) and
externalId are restricted, and that same-account role ARN changes are
allowed.
3. Fix the null-to-value mismatch. I think we can treat it as the intended
behavior from PR #4019 and update the code to match the flag doc. Otherwise
I'll correct the doc.
4. For gcpServiceAccount, I'd gate changes behind
ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES, per JB's suggestion. I'll
leave isHierarchical out of the role-changes gate unless someone sees a
reason to include it.

Questions:
- I could start with the spec first and the flag/doc fixes as a separate PR?
- Should null-to-value be allowed, as the flag doc says (I think yes)? Or
should the doc change?
- I'm in favour of reusing the existing flag for the GCP service account
instead of adding a new one?

Thanks,
Arnab

On Thu, Nov 19, 2026 at 4:21 PM Jean-Baptiste Onofré <[email protected]>
wrote:

> Hi all,
>
> Thanks for your message Arnab, and +1 to Yufei's point on clarifying
> the expected semantics per field first.
>
> I checked the current code and tests around
> validateUpdateCatalogDiffOrThrow and
> ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES, and a few details
> stood out:
>
> 1. Allowing roleARN updates within the same AWS account ID is
> intentional and explicitly tested
> (ManagementServiceTest.testUpdateCatalogChangesWithinSameAccountAllowed
> and
> PolarisManagementServiceIntegrationTest.testUpdateCatalogChangeRoleWithinSameAccountAllowed).
> So the ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES description is
> what's out of sync here, it mentions "role ARN" broadly, whereas the
> intended default guardrail is cross-account changes (awsAccountId) and
> externalId.
> Updating the doc to reflect that makes more sense than breaking
> same-account role rotation.
>
> 2. You are right that Objects.equals(...) currently rejects null ->
> value when ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES is false,
> which contradicts the flag description ("new values can be set when
> none were previously configured"). Fixing that discrepancy (code or
> doc, depending on whether we want null -> value allowed as PR #4019
> intended) seems worth doing regardless of any broader expansion.
>
> 3. All three storage integrations (AwsStorageCredentialCacheKey,
> GcpStorageCredentialCacheKey, AzureStorageCredentialCacheKey) include
> the full StorageConfigurationInfo in the cache key, so updating these
> fields won't serve stale cached credentials from the previous
> configuration.
>   - gcpServiceAccount is the closest counterpart to AWS role / Azure
> tenant impersonation (and is required when
> GCS_PRINCIPAL_ATTRIBUTION_ENABLED is enabled). However, making it
> unconditionally immutable would prevent rotating service accounts or
> populating it on older catalogs (especially since gcpServiceAccount
> only started taking effect in Polaris 1.4.0). If we restrict changes
> to it, it should be behind
> ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES (rather than always
> immutable or introducing another flag).
>   - isHierarchical reflects whether the Azure account uses HNS and
> controls SAS path scoping in AzureCredentialsStorageIntegration.
> Changing it is more likely fixing an initial catalog configuration
> mistake than a role/identity boundary change, so gating it behind a
> *_ROLE_CHANGES flag might be surprising.
>
> So overall, I would suggest:
> - In the short term, align the existing
> ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES doc and null -> value
> behavior with the tested semantics.
> - Agree with Yufei on documenting the exact update semantics and
> impact for each storage config field (identity/tenant boundary vs
> mutable operational setting) before adding new immutability checks.
>
> Thanks!
>
> Regards
> JB
>
> On Sat, Nov 14, 2026 at 8:53 AM Arnab Karmakar <[email protected]>
> wrote:
> >
> > Hi all,
> > I came across a TODO in
> > PolarisAdminService.validateUpdateCatalogDiffOrThrow (around line 1010):
> > "Expand the set of validations if there are other fields for other cloud
> > providers that we can't successfully apply changes to."
> >
> > Today the method rejects storage type changes, and rejects AWS account
> ID /
> > external ID changes and Azure tenant ID changes unless
> > ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES is true. Nothing is
> checked
> > for GCP or for the other Azure fields.
> > Gaps I confirmed in the code:
> > - GCP gcpServiceAccount is not checked on update. It is the service
> account
> > Polaris impersonates for credential vending, so changing it silently
> > changes the identity used.
> > - Azure isHierarchical is not checked on update. It changes how paths are
> > handled in credential vending.
> > - The published flag doc says AWS role ARN changes are restricted, but
> the
> > code only checks account ID and external ID, so a role change within the
> > same account is allowed.
> > - The flag doc says new values can be set when none were previously
> > configured. The code rejects a null-to-value change, so the two disagree.
> >
> > Proposal: add immutability checks for the fields that actually affect
> > credential vending, reuse ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES
> > (or add a new flag), and add tests for each rule. Azure
> multiTenantAppName
> > and consentUrl appear to have no consumers, so I would leave them out
> > unless someone knows otherwise.
> >
> > Questions:
> > 1. Is this worth doing now?
> > 2. Should the GCP service account be immutable under the same flag, or
> > always?
> > 3. Should AWS role ARN be restricted to match the doc, or should the doc
> > change?
> > 4. Should Azure isHierarchical be immutable?
> > 5. Reuse ALLOW_UNRESTRICTED_STORAGE_CONFIG_ROLE_CHANGES or add a new
> flag?
> >
> > I'm happy to take this if the direction is agreed.
> > Thanks,
> > Arnab
>

Reply via email to