HotSushi commented on PR #4446:
URL: https://github.com/apache/polaris/pull/4446#issuecomment-4455471588

   Closing this PR after deeper analysis.
   
   **Why `grantRecordsVersion=0` is not a valid state in Apache Polaris OSS**
   
   The OSS codebase has a consistent invariant that all entities start with 
`grantRecordsVersion=1`. This is enforced in:
   - The explicit constructors (`new PolarisBaseEntity(catalogId, id, ...)` 
sets it to `1` unconditionally)
   - The test suite (`PolarisTestMetaStoreManager` asserts 
`entity.getGrantRecordsVersion() >= 1` for every created entity)
   - The grant version increment logic (`entity.getGrantRecordsVersion() + 1` 
starting from 1)
   
   An entity with `grantRecordsVersion=0` cannot exist in a correctly operating 
Polaris deployment — it would mean an entity was created and persisted 
bypassing all normal initialization paths. Accepting `0` through the Builder 
would silently weaken this invariant for the entire OSS codebase.
   
   **Where the actual bug lives**
   
   The crash scenario described above (`grants_version_going_backward`) is 
caused by a Snowflake-specific persistence layer that serializes an entity with 
`grantRecordsVersion=0` (derived from an internal versioning field that starts 
at 0 rather than 1). This is a mismatch between the Snowflake persistence 
layer's versioning convention and the Polaris OSS invariant. The fix belongs in 
the Snowflake-managed fork's persistence layer — normalizing `0` to `1` when 
constructing the entity from the Snowflake-specific data source — not in the 
OSS Builder.
   
   Closing in favour of a targeted fix in the private fork.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to