yuqi1129 opened a new issue, #12653:
URL: https://github.com/apache/gravitino/issues/12653
### Describe the subtask
Complete database optimistic concurrency control (OCC) and atomic writes for
managed views, following the transaction ordering and conflict classification
established for tables in #12345 / #12551.
- Use `view_meta.current_version` as the OCC token and keep `last_version`
monotonic.
- Retain the version-checked view-meta update, but execute it before
inserting an unguarded `view_version_info` row.
- Treat a zero-row update as an OCC or identity conflict instead of a
generic `IOException`.
- Make direct view deletion version checked. Delete the root row before view
versions, ownership, securable objects, tags, and other dependent rows.
- Keep every write from one service API call in one transaction so a
version-row or dependent-row failure also rolls back the root CAS.
- Use a locking read by stable view ID to classify a zero-row CAS:
- the same view still exists with a newer version ->
`OptimisticLockException`;
- the view was deleted, renamed, or moved -> `NoSuchEntityException`.
- Fence the active parent schema during creation and lock the target schema
when moving a view between schemas.
- Preserve monotonic versions on `put(overwrite=true)` instead of resetting
an existing view to its initial version.
- No database migration is required because `current_version` and
`last_version` already exist.
Acceptance criteria:
- Concurrent view alters cannot overwrite the winning version metadata.
- A failed CAS leaves no partial `view_version_info` or relationship rows.
- Concurrent alter/delete and schema-move/delete operations have exactly one
winner.
- Rename/delete races are classified as not found; same-identity version
races are classified as OCC conflicts.
- SQL-provider and service tests cover H2, MySQL, and PostgreSQL behavior.
Depends on #12341.
References: #12345, #12551, #12597.
### Parent issue
https://github.com/apache/gravitino/issues/12166
--
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]