You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "jerryshao (via GitHub)" <gi...@apache.org> on 2026/08/27 07:57:11 UTC
[I] [Subtask] Add optimistic-concurrency-checked update for job entities [gravitino]
jerryshao opened a new issue, #12669:
URL: https://github.com/apache/gravitino/issues/12669
### Describe the subtask
`JobMetaService` has no `updateJob` method — only `insertJob(entity, overwrite)`, which calls `insertJobMetaOnDuplicateKeyUpdate`, a raw last-writer-wins upsert with no DB-level concurrency check. `JobPO` already has unused `currentVersion`/`lastVersion` columns intended for exactly this.
Today `JobManager` compensates manually at each mutation site (`cancelJob`, `pullAndUpdateJobStatus`) by taking a coarse `LockType.WRITE` tree lock and re-fetching the latest entity inside it before overwriting — a pattern that has to be re-implemented correctly at every call site instead of being enforced once at the DB layer. This is inconsistent with the sibling `JOB_TEMPLATE` entity's `alterJobTemplate`, which uses `entityStore.update(...)` under a `LockType.READ` lock because the storage-layer update handles versioning transactionally.
**Proposed change:**
- Add a version-checked `updateJob` to `JobMetaService` (mirroring `JobTemplateMetaService`'s versioned update), using `JobPO.currentVersion`/`lastVersion`.
- Wire an `EntityStore.update` path for `JOB` entities.
- Switch `JobManager.cancelJob` and `pullAndUpdateJobStatus` to use `entityStore.update(...)` under a `LockType.READ` lock instead of manual re-fetch + `put(overwrite=true)` under `LockType.WRITE`.
### Parent issue
#12667
--
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: commits-unsubscribe@gravitino.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Subtask] Add optimistic-concurrency-checked update for job entities [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao closed issue #12669: [Subtask] Add optimistic-concurrency-checked update for job entities
URL: https://github.com/apache/gravitino/issues/12669
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org