yuqi1129 opened a new pull request, #12994:
URL: https://github.com/apache/gravitino/pull/12994

   ### What changes were proposed in this pull request?
   
   Complete version-CAS updates and soft-deletes for Job and Job Template using 
the shared OCC helpers. Classify a stale active row as an optimistic-lock 
conflict and preserve missing-entity/idempotent-delete behavior.
   
   Fence insertion with metalake and template row locks. Delete the template 
root by expected version before cascading to jobs by stable template ID, with 
one transaction covering both. Remove the superseded unversioned single-entity 
delete paths.
   
   Keep background status polling alive after an OCC conflict and defer 
staging-directory cleanup until template deletion succeeds.
   
   ### Why are the changes needed?
   
   Both entities already increment versions, but losing updates are reported as 
missing entities and deletes bypass version checks. Concurrent creation and 
deletion can leave orphan metadata, and failed template deletion can remove 
child jobs or staging files. A new optimistic-lock exception must not terminate 
the scheduled status poller.
   
   Fix: #12992
   Fix: #12993
   
   ### Does this PR introduce _any_ user-facing change?
   
   Stale writes use the existing OCC conflict contract rather than being 
misreported as missing entities. Job deletion respects its metalake namespace. 
Template deletion failures retain staging files, and background polling 
continues after conflicts.
   
   No changes to public API signatures, configuration keys, database schema, 
job identifiers, runtime-template JSON, or blind create/import overwrite 
semantics. External job submission and cancellation are not retried by this 
change.
   
   ### How was this patch tested?
   
   - 123 targeted tests passed with H2, MySQL, and PostgreSQL enabled, 
including all 11 new OCC scenarios on each database.
   - The final source passed 74 targeted tests with H2, including the 
additional cancellation-without-replay regression.
   - `:core:spotlessApply`, compilation with Error Prone / `-Werror`, and 
`:core:check` passed. No failures or skips.
   
   The full repository suite and external job-executor deployment tests were 
not run.
   
   Coverage includes version-only concurrent changes, stale deletes, 
update/delete races, missing parents, create/delete fencing, template rename 
and same-name recreation, cascade rollback, polling continuity, staging-file 
preservation, and cancellation without replay.
   


-- 
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