ShivanshhhG opened a new pull request, #18581:
URL: https://github.com/apache/iceberg/pull/18581
Fixes #18552.
### Problem
In `POST /v1/{prefix}/transactions/commit`, multi-table transactions can
specify requirements on tables that are not updated (e.g. read-only cross-table
assertions or key dependency checks).
Previously, requirements were only evaluated in-memory during initial
staging; because tables without updates never execute an underlying commit
(`base == current` in `BaseTransaction`), their requirements were not
re-checked against refreshed table metadata at commit time.
Furthermore, concurrent multi-table commits against the catalog were not
isolated, allowing concurrent transactions asserting contradictory states to
both commit successfully.
### Solution
1. Add `CatalogHandlers.commitTransaction(Catalog,
CommitTransactionRequest)` with catalog-level synchronization to serialize
multi-table transaction commits against the catalog.
2. Re-validate requirements for tables with empty updates against refreshed
metadata in the catalog prior to committing.
3. Update `RESTCatalogAdapter` to delegate `commitTransaction` to
`CatalogHandlers`.
4. Add comprehensive unit tests in `TestRESTCatalog`:
- `multipleDiffsWithRequirementOnlyTable`: Verifies valid
requirement-only tables commit cleanly alongside update tables.
- `multipleDiffsWithRequirementOnlyTableFails`: Verifies stale
requirements on requirement-only tables fail with `CommitFailedException` and
prevent all table commits in the transaction.
- `concurrentCommitTransactionsWithCrossRequirementOnlyTables`: Verifies
concurrent conflicting multi-table transactions (reproducing the scenario from
#18552) cannot both commit.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]