venkateshwaracholan opened a new pull request, #4605: URL: https://github.com/apache/polaris/pull/4605
## Summary `JdbcGrantRecordsIdempotencyTest` already verifies that calling `writeToGrantRecords` twice with the same grant is a no-op on H2 (schema versions v1โv4) and that only SQL state `23505` is treated as a duplicate-key violation (mocked path). This change adds PostgreSQL integration coverage for the real insert path: duplicate grant writes against a live unique constraint on `grant_records`, using the same Testcontainers + `postgres/schema-v4.sql` pattern as `RelationalJdbcIdempotencyStorePostgresIT`. No production code changes. ## Current vs expected behavior **Before:** Grant idempotency on JDBC was exercised on H2 only for the integration-style double-write test. **After:** The same scenario runs on PostgreSQL (schema v4): both writes succeed without throwing, and exactly one matching row remains in `polaris_schema.grant_records`. ## Changes - Add `JdbcGrantRecordsIdempotencyPostgresIT` (Testcontainers `PostgreSQLContainer`, bootstrap via `postgres/schema-v4.sql`, `JdbcBasePersistenceImpl`). - Assert duplicate `writeToGrantRecords` does not throw and `COUNT(*)` for the grant PK is `1`. ## Test plan - [x] `./gradlew :polaris-relational-jdbc:test --tests "org.apache.polaris.persistence.relational.jdbc.JdbcGrantRecordsIdempotency*"` ## Checklist - [ ] ๐ก๏ธ Don't disclose security issues! (contact [email protected]) - [ ] ๐ Clearly explained why the changes are needed, or linked related issues: Fixes # - [ ] ๐งช Added/updated tests with good coverage, or manually tested (and explained how) - [ ] ๐ก Added comments for complex logic - [ ] ๐งพ Updated `CHANGELOG.md` (if needed) - [ ] ๐ Updated documentation in `site/content/in-dev/unreleased` (if needed) -- 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]
