Skip to content

migration 0059 over-sets is_blocked on dolt < 2.4.0 (dolt#11886) - stores that crossed it hide ready work #7037

Description

@seanmartinsmith

hit this crossing my fleet from a main build at 1823f47 (schema 55) to 1.3.0 (f45b249): migration 0059 set is_blocked=1 on issues that aren't blocked, so they silently dropped out of bd ready. on the biggest db (1468 issues) ready went 334 -> 255

measured

bd 1.3.0 (f45b249), dolt sql-server 2.2.1, server mode, shared server with a dolt remote, windows 11. designated-migrator crossing (bd migrate schema --force), first on a sandbox copy with real data, then 27 live dbs:

  • in dolt_diff_issues the 0059 commit is the only one touching is_blocked: 80 rows 0 -> 1 on that db
  • e.g. an issue whose only edges are relates-to ends up is_blocked=1 and isn't in bd blocked
  • bd recompute-blocked right after migrating: 322 rows corrected across 9 of 27 dbs (130, 96, 80, 5, 3, 3, 3, 1, 1). ready back to 334 on the big one
  • bd doctor "Blocked State" flagged 65 on that db, the recompute corrected 80

cause

0059's recursive step (0059_recompute_null_gate_is_blocked.up.sql:250-257 at v1.3.0, unchanged on main 448c4b8):

JOIN dependencies d
  ON d.type = 'parent-child'
 AND ((r.kind = 'issue' AND d.depends_on_issue_id = r.id)
   OR (r.kind = 'wisp'  AND d.depends_on_wisp_id  = r.id))

type and both target columns are indexed, which is exactly dolthub/dolt#11886: the planner concatenates two index lookups and keeps only the OR as the residual filter, so d.type = 'parent-child' is dropped and blockedness propagates across every edge type. #11886's impact section quotes this join.

on the untouched schema-55 copy through the same 2.2.1 server, 0059's CTE as a SELECT returns 105. the same CTE with the recursive step rewritten without the OR (one join on d.depends_on_issue_id = r.id, kind and type in WHERE) returns 25, which matches the pre-upgrade build's own count. 105 - 25 = 80, the flip count.

ruled out: data (the old build's runtime count and the OR-free variant agree at 25), dirty state (clean dolt_status; only the 0059 commit flips rows). the runtime recompute (issueops/blocked_state.go, what bd recompute-blocked runs) doesn't use this shape and is correct on the same engine.

who's exposed

  • fix is go-mysql-server#3899 (merged 09-18), first released in dolt v2.4.0 (09-30). every server before that has it: #11886 reproduced on 2.3.1/2.3.5, i measured 2.2.1. the ci pin in scripts/ci/install-dolt.sh:26 is 2.2.0
  • bd's embedded engine: go.mod pins go-mysql-server at ...20260713210757-6d01d00bbbf3 (v1.3.0) and ...20260805191915-e5eafe0da809 (main, hotfix/1.3.1). both predate docs: list all integration pages in website nav #3899, so does fix(deps): bump dolt/go past the conjoin re-wording and re-open fixes (#6265) #6811's target (...20260915233322). i haven't reproduced embedded, that's inference from the pin
  • same join in 0047_recompute_mixed_is_blocked, ignored/0007_recompute_wisp_is_blocked and ignored/0015_recompute_null_gate_wisp_is_blocked - the ignored twins run on every clone
  • bd doctor only catches it in server mode, so embedded users get no signal

fix shape (0059's bytes are frozen, so not an edit to it)

  1. now: a line in upgrading.md / the 1.3.x notes - after crossing 0059 on dolt < 2.4.0 or embedded, run bd recompute-blocked once per db on every clone. it's idempotent
  2. a new main migration + ignored twin that recomputes with an OR-free recursive step (two UNIONed joins, which #11886 shows is correct), so stores that already crossed get repaired without anyone knowing to act
  3. heads-up on Migration 0059 exceeds two hours on a 14k-wisp-dependency graph #6520: its proposed stand-in indexes would put the same shape on the wisp branch

detection: bd recompute-blocked --json - rows_corrected > 0 means you were hit

prior art: dolthub/dolt#11886 (fixed), #6520, #4138, #6608, #6716. nothing on the beads side tracks the stores that already crossed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBroken existing behaviorpriority/p1High: core workflow broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions