You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Teach the debugging skill the DoltLite backend-plugin (not just Dolt)
The pack modeled the data plane as the Dolt mysql sql-server (PROCESSLIST,
a TCP port, DOLT_GC over the wire) and treated doltlite as a generic raw
SQLite file. It had no notion of the current DoltLite *backend-plugin*
deployment: bd/gc run plain (unlinked) and speak to `bd-backend-doltlite
serve` (over stdio) + `gc-doltlite-fastpath serve`, with the store at
`.beads/doltlite/*.db` and no TCP server at all.
Make the skill backend-aware:
- gas-stack-map: add a "detect the backend FIRST" recipe (`.beads/metadata.json`
is ground truth) and split the data plane into three real deployments —
dolt sql-server, doltlite linked, doltlite backend-plugin. Note backends
can coexist per-city on a shared box.
- gc-diagnostic-toolkit: tag the sql-server section as dolt-only; rewrite the
doltlite section for the plugin model — query through `bd sql` (not a raw
`sqlite3` open, which bypasses the working-set/commit model), inspect the
`…serve` procs and store dir, and use DoltLite SQL maintenance functions.
Point to the authoritative `beads-doltlite` skill for dolt_gc/flatten/locks.
- SKILL: reflect the pluggable backend in the stack tree.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: skills/debugging-gas-issues/references/gas-stack-map.md
+15-4Lines changed: 15 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The symptom surfaces high in the stack (a `gc` command feels slow, an agent stal
13
13
| go-mysql-server (gms) |`dolthub/go-mysql-server`| The SQL engine embedded in dolt: query planning, index selection, joins, expression eval | a dolt dependency (check dolt's `go.mod`) |
14
14
| vitess |`dolthub/vitess`| MySQL wire protocol + SQL parser used by gms | a gms dependency |
15
15
| driver |`dolthub/driver`| The Go `database/sql` driver gc/bd use to talk to a dolt server | a gc/bd dependency |
16
-
| doltlite |`dolthub/doltlite`(`doltlite-python`) | SQLite-backed version-controlled store — an alternative to dolt; **no mysql sql-server, no port**| the consumer's build cache; an on-disk SQLite file|
16
+
| doltlite |`dolthub/doltlite`+ the beads **backend plugin** (`bd-backend-doltlite`) & gc **fastpath** (`gc-doltlite-fastpath`) | SQLite-backed version-controlled store — an alternative to dolt; **no mysql sql-server, no port**. In the *plugin* deployment bd/gc are plain (unlinked) and talk to a `…serve` subprocess over stdio |`.beads/doltlite/*.db`; the co-located plugin binaries (e.g. `~/.local/lib/beads-plugin/`); `.beads/metadata.json` names them|
17
17
18
18
## Ground-truth sources (consult before tracing or changing behavior)
# mismatch -> your trace may not reflect the binary; rebuild or check out the right commit
44
44
```
45
45
46
-
## dolt vs doltlite (don't assume mysql)
46
+
## Which data plane? — detect the backend FIRST (don't assume mysql)
47
47
48
-
-**dolt**: a MySQL-protocol `sql-server` on a TCP port. Diagnose with `SHOW PROCESSLIST`, `information_schema.processlist`, global status, `ss`/`lsof` on the port. Port resolution: `--port` flag > city `dolt.port` config > `<rig>/.beads/dolt-server.port` file > legacy default.
49
-
-**doltlite**: a version-controlled **SQLite** file. **No server, no port, no PROCESSLIST.** Diagnose with SQLite tooling against the file (`.dolt`/`.doltlite` dir), file size on disk, and the consuming process's own profiling. The CPU-vs-load, binary-grep, bead-store-layout, and dogfood techniques still apply; the *server* techniques do not. Check which backend the city/store actually uses before reaching for `SHOW PROCESSLIST`.
48
+
There are now **three** beads data-plane deployments and their diagnostics differ completely. `.beads/metadata.json` is the ground truth — read it *before* reaching for `SHOW PROCESSLIST`:
ls -d .beads/dolt .beads/doltlite 2>/dev/null # which store dir exists
53
+
pgrep -af 'dolt sql-server|bd-backend-doltlite|gc-doltlite-fastpath'# which serve procs are live
54
+
```
55
+
56
+
-**dolt (sql-server)** — `backend: dolt`; a MySQL-protocol server on a TCP port, store under `.beads/dolt`. Diagnose with `SHOW PROCESSLIST`, `information_schema.processlist`, global status, `ss`/`lsof` on the port. Port resolution: `--port` > city `dolt.port` > `<rig>/.beads/dolt-server.port` > legacy default.
57
+
-**doltlite, linked** — `backend: doltlite`, **no**`backend_plugin_command`; DoltLite compiled *into* bd/gc. Version-controlled, SQLite-backed; **no server, no port, no PROCESSLIST.**
58
+
-**doltlite, backend-plugin***(current on house-staff)* — `backend: doltlite`**with**`backend_plugin_command` set. bd/gc are plain (unlinked) and launch `bd-backend-doltlite serve` (bd storage, over stdio, per-invocation) + `gc-doltlite-fastpath serve` (gc's always-on read fastpath). Store is `.beads/doltlite/*.db`; the plugin binaries are co-located (metadata names them). **No TCP server** — you cannot `SHOW PROCESSLIST` or `ss` a port. Inspect via `bd sql` (routed through the plugin), the `…serve` processes, the store dir on disk, and the DoltLite SQL maintenance functions. Deep commands + gotchas (`dolt_gc`, flatten, maintenance, locks, native read fastpath): the **`beads-doltlite`** skill is authoritative.
59
+
60
+
On a shared box the backends can coexist **per city** (one city on the plugin, a throwaway on a dolt sql-server) — so detect per store, never assume per host.
50
61
51
62
See `gc-diagnostic-toolkit.md` for the concrete commands per backend.
Aggregates sustained CPU by command. (`ps` %CPU is lifetime-average — misleading for "now".)
42
42
43
-
## dolt server introspection
43
+
## dolt server introspection (backend: dolt only — confirm first)
44
+
45
+
Applies to the **dolt sql-server** backend. On a doltlite backend there is no server/port/PROCESSLIST — skip to the doltlite section. Confirm with `jq -r .backend .beads/metadata.json`.
Disk reclaim after deleting rows is a **dolt** GC: `CALL DOLT_GC('--full')` (online-safe; quiesce writers first). `gc dolt compact` gates on commit count and skips low-commit/high-churn dbs.
70
72
71
-
## doltlite (SQLite backend)
73
+
## doltlite (embedded backend — linked or plugin)
72
74
73
-
No server/port/PROCESSLIST. Inspect the file:
75
+
No server/port/PROCESSLIST. First confirm which doltlite deployment (see `gas-stack-map.md` → "Which data plane?"):
du -sh .beads/doltlite 2>/dev/null # store size on disk
80
+
```
81
+
Query **through bd** (routed to the backend — works for linked and plugin), not a raw `sqlite3` open of the `.db` (that bypasses the working-set/commit model and can read a stale or locked view):
74
82
```bash
75
-
du -sh <store>/.doltlite 2>/dev/null
76
-
sqlite3 <store-file>'SELECT issue_type, COUNT(*) FROM issues GROUP BY issue_type;'# adapt to the actual schema/path
83
+
bd sql -q "SELECT issue_type, COUNT(*) n, SUM(status='closed') closed FROM issues GROUP BY issue_type ORDER BY n DESC"
77
84
```
78
-
The CPU-vs-load, binary-grep, store-layout, and dogfood techniques still apply; the server techniques do not. **Check the backend before reaching for `SHOW PROCESSLIST`.**
85
+
Disk reclaim / maintenance is a **DoltLite** operation, not `CALL DOLT_GC` over a wire — use the DoltLite SQL functions (`SELECT dolt_gc();`, flatten, maintenance) and mind the store locks. The **`beads-doltlite`** skill is the authoritative reference for those, the native read fastpath, and DoltLite lock/maintenance gotchas. The CPU-vs-load, binary-grep, store-layout, and dogfood techniques still apply; the server techniques (`PROCESSLIST`, `ss` on a port, `DOLT_GC('--full')` over the wire) do not. **Check the backend before reaching for `SHOW PROCESSLIST`.**
0 commit comments