Beads store on a managed dolt sql-server
Embedded-mode bd pays engine open + a store lock per call; a persistent `dolt sql-server` endpoint removes both. Install, cold-start fallback, diagnostics, revert.
Default bd runs Dolt embedded: every bd call opens the database
and takes a store flock (~1s+, serialized). Under orchestrator
concurrency β loop + drive + watch read planes β bd calls queue
behind their own lock and ETIMEDOUT. Server mode flips it: a
persistent dolt sql-server owns the data dir, bd hits a socket, and
per-call startup disappears.
What the setup is
- Data β
.beads/dolt/(server-mode convention; the embedded.beads/embeddeddolt/content is the same<db>/.doltlayout β the move is a rename, not a conversion). - Endpoint β
127.0.0.1:<port>, pinned in.beads/config.yaml(dolt.host/dolt.port) and.beads/dolt-server.port. - Managed lifecycle β
dolt.auto-start: falsein thedolt:config block: bd must not spawn an unsupervised twin β endpoint down is a fast connection-refused, not a surprise fork. Asystemd --userunitbeads-dolt-<repo>-<hash6>.service(Restart=on-failure; the hash keys the unit to the store path so same-named repos can't collide) keeps the server up across reboots (linger required). - Same config file, both paths β
.beads/dolt-server-config.yamlis the unit's--configand whatbd dolt startreuses manually β one port, no drift.
Install / migrate
node scripts/beads-dolt-server.ts install # store at ./.beads or $BEADS_DIR
node scripts/beads-dolt-server.ts install --beads /path/to/.beads --port 37934
node scripts/beads-dolt-server.ts status # mode, endpoint reachability, unit stateinstall is idempotent: moves embeddeddolt/ β dolt/, writes the
server config + port file, flips metadata.json to dolt_mode: server, adds the dolt: block + gc.endpoint_* markers to
config.yaml, renders the unit, systemctl --user enable --now, then
bd dolt test.
Cold start
Endpoint down (bd fails fast with "auto-start is disabled"):
systemctl --user start beads-dolt-<repo>-<hash>.service # managed path β `status` prints the name
bd dolt start # manual fallback β same config, same portThe unit survives reboot only with linger
(loginctl enable-linger <user>). Logs:
journalctl --user -u beads-dolt-<repo>-<hash>.service (or
.beads/dolt-server.log for bd dolt start).
Revert to embedded
node scripts/beads-dolt-server.ts uninstall # unit + endpoint block gone
cd <repo> && mv .beads/dolt .beads/embeddeddolt
# metadata.json: dolt_mode β "embedded", drop dolt_server_host
# remove the dolt: block from .beads/config.yamluninstall leaves the store server-mode pointing at a dead endpoint β
the mv + metadata flip is what completes a real revert.