Summary
CALL DOLT_ADD / CALL DOLT_COMMIT executed inside a still-open SQL transaction can materialize a Dolt commit from the session's pre-merge transaction snapshot. Under concurrent writers on one branch this can silently write concurrently-committed rows back to their BEGIN-time values (lost updates). The mechanism is documented Dolt behavior history — dolthub/dolt#5205 and the dolthub/dolt#5608→#5621 staged-root-merge family — and PR #5740 reports reproducing the revert in production server mode and fixes the main issue-mutation path (runIssueOperationTxWithMessage) by moving the Dolt commit strictly after the SQL COMMIT.
This issue tracks the remaining in-tx surface, so the migration list lives somewhere that can't rot in a code comment.
Remaining in-tx DOLT_ADD/DOLT_COMMIT sites (as of current main)
doltAddAndCommitInTx itself (internal/storage/dolt/ephemeral_routing.go) and its callers:
- wisp promote / demote (ephemeral_routing.go)
- legacy write paths in issues.go —
UpdateIssue, UpdateIssueChecked, ClaimIssue, ClaimReadyIssue, UnclaimIssue, UnclaimIssueIfAssignee, ReclaimExpiredLeases, CloseIssue*, DeleteIssue*, MergeMetadata (several reachable from live CLI paths: bd edit/note/priority/defer/unclaim, linear sync)
- slots.go (
SlotClear)
RunInIssueLifecycleTransaction (transaction.go)
- deleter.go stages via inline
CALL DOLT_ADD in-tx as well
- Contrast: creates, comments, labels, and dependencies already use the post-tx
doltAddAndCommit — the safe ordering this issue asks the remaining sites to adopt.
Acceptance
Every mutating path stages and Dolt-commits after its SQL transaction commits (post-merge working set), or documents a specific reason it cannot. doltAddAndCommitInTx is deleted or reduced to callers with a written justification. Sequence-contract tests in the style of PR #5740's dolt_commit_ordering_test.go pin the ordering for the migrated paths.
References
Summary
CALL DOLT_ADD/CALL DOLT_COMMITexecuted inside a still-open SQL transaction can materialize a Dolt commit from the session's pre-merge transaction snapshot. Under concurrent writers on one branch this can silently write concurrently-committed rows back to their BEGIN-time values (lost updates). The mechanism is documented Dolt behavior history — dolthub/dolt#5205 and the dolthub/dolt#5608→#5621 staged-root-merge family — and PR #5740 reports reproducing the revert in production server mode and fixes the main issue-mutation path (runIssueOperationTxWithMessage) by moving the Dolt commit strictly after the SQL COMMIT.This issue tracks the remaining in-tx surface, so the migration list lives somewhere that can't rot in a code comment.
Remaining in-tx DOLT_ADD/DOLT_COMMIT sites (as of current main)
doltAddAndCommitInTxitself (internal/storage/dolt/ephemeral_routing.go) and its callers:UpdateIssue,UpdateIssueChecked,ClaimIssue,ClaimReadyIssue,UnclaimIssue,UnclaimIssueIfAssignee,ReclaimExpiredLeases,CloseIssue*,DeleteIssue*,MergeMetadata(several reachable from live CLI paths: bd edit/note/priority/defer/unclaim, linear sync)SlotClear)RunInIssueLifecycleTransaction(transaction.go)CALL DOLT_ADDin-tx as welldoltAddAndCommit— the safe ordering this issue asks the remaining sites to adopt.Acceptance
Every mutating path stages and Dolt-commits after its SQL transaction commits (post-merge working set), or documents a specific reason it cannot.
doltAddAndCommitInTxis deleted or reduced to callers with a written justification. Sequence-contract tests in the style of PR #5740'sdolt_commit_ordering_test.gopin the ordering for the migrated paths.References