{"record":{"id":"a62c9deb9a536a8f","repo":"gastownhall/beads","slug":"commit-is-blocked-recompute-w","errorCode":null,"errorMessage":"commit is_blocked recompute: %w","messagePattern":"commit is_blocked recompute: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dolt/store.go","lineNumber":4525,"sourceCode":"\treturn s.withCircuitWrite(ctx, func(ctx context.Context) error {\n\t\treturn s.recomputeBlockedAfterPullUnchecked(ctx, fromCommit)\n\t})\n}\n\nfunc (s *DoltStore) recomputeBlockedAfterPullUnchecked(ctx context.Context, fromCommit string) error {\n\tif err := s.recomputeBlockedTx(ctx, fromCommit); err != nil {\n\t\t// The merge this recompute covers is already committed, so a plain\n\t\t// retry on the next pull would skip as \"nothing merged\" — leave a\n\t\t// marker so it widens its window instead (bd-578h9.11). Best-effort:\n\t\t// the recompute error is what matters.\n\t\ts.markBlockedRecomputePending(ctx, fromCommit)\n\t\treturn err\n\t}\n\t// Derived state converges: every clone computes the same values from the\n\t// same merged graph, so committing is merge-safe. Commit no-ops when the\n\t// recompute changed nothing.\n\tif err := s.commitWorkingSetAfterSQLCommit(ctx, \"bd: recompute is_blocked after pull\", configExclude); err != nil && !isDoltNothingToCommit(err) {\n\t\treturn fmt.Errorf(\"commit is_blocked recompute: %w\", err)\n\t}\n\treturn nil\n}\n\n// RecomputeAllBlocked recomputes is_blocked for every issue and wisp in one full\n// pass and returns the number of rows it corrected. It is the mode-independent\n// repair behind 'bd recompute-blocked' and 'bd doctor --fix' (bd-6dnrw.37): the\n// scoped post-pull recompute is skipped when a re-pull merges nothing, so a\n// recompute that failed after its merge committed — or a conflicted pull the\n// operator resolved by hand — leaves is_blocked stale until this full pass runs.\n// Idempotent: a consistent database corrects nothing.\nfunc (s *DoltStore) RecomputeAllBlocked(ctx context.Context) (int, error) {\n\tvar changed int\n\terr := s.withCircuitWrite(ctx, func(ctx context.Context) error {\n\t\tvar err error\n\t\tchanged, err = s.recomputeAllBlocked(ctx)\n\t\treturn err\n\t})","sourceCodeStart":4507,"sourceCodeEnd":4543,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/store.go#L4507-L4543","documentation":"Wraps a failure of commitWorkingSetAfterSQLCommit when bd commits the recomputed is_blocked values after a pull. The recompute result is derived state that converges across clones and is committed as its own bd commit; if that commit fails for a reason other than 'nothing to commit' (isDoltNothingToCommit), the pull already succeeded but the derived-state commit failed.","triggerScenarios":"After a successful pull and is_blocked recompute, s.commitWorkingSetAfterSQLCommit returns an error that is not Dolt's 'nothing to commit' — e.g. another writer moved the head (merge conflict on the derived commit), the working set is dirty, or the connection dropped before commit.","commonSituations":"Concurrent bd processes committing at the same time; pull landed on a stale head; uncommitted local edits present when the recompute ran; transient Dolt server errors during commit.","solutions":["Re-run `bd dolt pull` — the recompute is idempotent and will be retried","Check for concurrent bd processes and ensure only one writer runs at a time","Inspect the wrapped cause for 'nothing to commit' (harmless) vs real commit failure","Verify the working set has no uncommitted conflicting edits before pulling"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := store.Pull(ctx); err != nil {\n    if strings.Contains(err.Error(), \"commit is_blocked recompute\") &&\n       !strings.Contains(err.Error(), \"nothing to commit\") {\n        // safe to retry: the recompute commit is idempotent\n        err = store.Pull(ctx)\n    }\n    return err\n}","preventionTips":["Serialize bd writes; avoid multiple bd processes committing at once","Pull regularly so heads do not diverge far","Commit local edits before pulling so the working set is clean"],"tags":["dolt","commit","derived-state","recompute"],"backgroundTag":"dolt-commit-conflict","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}