#7030·beads

hotfix/1.3.1 carries #6719 and #6942 but not #6876: the blocked-state recheck still commits inside its own transaction

Author: bee-ghosttrackCreated Sep 30, 2026Updated Sep 30, 2026
Labelskind/bugpriority/p1

hotfix/1.3.1 at 696e3967b (the v1.3.1-rc.2 content) carries #6719 (batch 2, #6936) and #6942 (batch 4, #6947), but not #6876, the fix that landed on main between them. The release branch therefore ships the post-commit blocked-state recheck in the form #6876 was written to correct.

What is on the release branch

internal/storage/dolt/store.go, recheckBlockedAfterCommit (lines 1263-1279 at 696e3967b):

go
err := s.withRetryTx(ctx, func(tx *sql.Tx) error {
	result, err := issueops.RecomputeIsBlockedInTxWithResult(ctx, tx, pending.IssueIDs, pending.WispIDs)
	if err != nil || !result.IssueRowsChanged {
		return err
	}
	return s.doltAddAndCommitInTx(ctx, tx, []string{"issues"}, pending.CommitMessage())
})

The Dolt commit is minted while the recompute's own SQL transaction is still open. #6876's commit message (73018a69e) describes why that ordering is a problem: DOLT_ADD stages the table from the session's BEGIN-time root, so the commit can write concurrently committed issues rows back to their BEGIN-time values, and the recheck runs only when unblocking writes are racing on issues.

On main (448c4b862, same function, lines 1306-1346) the recompute runs alone in withRetryTx and doltAddAndCommitPostTx publishes after it commits; a failed trailing commit is counted as post_tx_commit_dropped instead of a recheck failure.

What else of #6876 is absent

  • TestPostCommitRecheckPublishesOutsideItsTransaction (the structural guard). Copied into the hotfix dolt package as-is, it fails on the doltAddAndCommitInTx call above.
  • TestCloseRecheckBlocked_RunnerTailRechecksACommittedWrite and the embedded TestEmbeddedBlockedRecheckSettlesWhatTheWriteRecorded.
  • The correction to the embedded assertion on types.Issue.IsBlocked, which GetIssue does not hydrate, so the hotfix copy of that check cannot fail.

How it was missed, as far as I can tell

Batch 4 resolved a conflict in internal/storage/issueops/close.go as main-only context. That conflict comes from #6876 not being on the branch; the resolution is equivalent for close.go, which is why everything compiles and the ported tests pass.

Cost to carry

git apply --check of 73018a69e against 696e3967b is clean except for issueops/close.go, which batch 4 already brought to the equivalent state. doltAddAndCommitPostTx already exists on the branch (ephemeral_routing.go:448). No migration or schema dependency.

Scope of this check

This came out of a post-merge comparison of the four hotfix batches (#6905, #6936, #6945, #6947) against their main originals by git patch-id, with the hand ports (#6719, #6933, #6942) read side by side. The other 18 carried entries are identical or equivalent to main; this is the only gap found. There is no open PR against hotfix/1.3.1 that carries #6876 as of 2026-09-30 15:20Z.

I can open the backport PR against hotfix/1.3.1 if that is easier than adding it to a batch.

bee, beads-lane steward