Shed reachable Dolt history that dolt gc cannot reclaim
Every bead write mints a Dolt commit, and Dolt keeps every byte a reachable
commit references — dolt gc only reclaims what nothing points to. A
workspace that has accumulated months of high-frequency writes can grow far
past its live data (gigabytes of storage for a few thousand beads) while
dolt gc reclaims nothing, because the entire chain is still reachable from
your branch. This runbook squashes that chain to a single baseline commit so
the old history becomes collectable, without touching your live data.
This procedure rewrites history. Every other clone of the database becomes
unmergeable and must re-clone, and remotes and backups must be re-pointed.
Run it in a fenced window: all writers stopped on every machine that syncs
this database, backup verified first.
Symptoms
The Dolt data directory (or its remote/backup) is large and growing while
bd stats shows a modest number of beads
dolt gc and dolt gc --full reclaim little or nothing
Cloning or pulling the database is slow far out of proportion to its content
Diagnosis
Run these inside the Dolt data directory — .beads/embeddeddolt/<database>/
in embedded mode, .beads/dolt/<database>/ in server mode:
# How big is the store?du -sh .# How deep is the history? Thousands of commits with a small live# dataset means the history, not the data, is the bloat.dolt log --oneline | wc -l# Confirm gc has nothing unreachable to collectdolt gc --full
If dolt gc --full frees the space, you are done — no squash needed.
Solution
Step 1: Fence and back up. Stop every writer: agents, background
services, and — easiest to miss — any scheduled sync job (cron, launchd,
systemd) that pushes or pulls this database, on every machine that syncs
it, not just the one you squash on. List the machines and their sync units
by name and verify each is stopped. One live peer sync undoes the squash on
its next tick: it pulls the new baseline, cross-merges it into its old
chain, and pushes the entire old history back to the fresh remote. In
server mode also stop the server after backing up. The backup is dolt-native
and keeps the full history, so it remains your rollback.
bd backup syncbd dolt stop
Step 2: Squash to a single baseline. From the Dolt data directory,
re-commit the current tree directly on top of the root commit. Keeping the
root as the sole ancestor preserves a valid chain — do not try to “simplify”
further by starting an orphan branch:
Step 3: Drop the other refs and collect. Anything still pointing at the
old chain keeps it alive — stale local branches and tags, and also the
remote-tracking refs left behind by every past push and fetch, which any
long-lived synced workspace has. Delete them all before collecting; Step 4’s
force-push recreates the remote-tracking refs on the new chain:
dolt branch # delete stale branches: dolt branch -D <name>dolt branch -r # delete remote-tracking refs: dolt branch -rd <remote>/<branch>dolt tag # delete stale tags: dolt tag -d <name>dolt gc --fulldu -sh . # verify: the store should now be a fraction of its old size
If the size barely moved, a ref still anchors the old chain — re-check
dolt branch, dolt branch -r, and dolt tag for survivors and collect
again. (A failed collection does not endanger Step 4 — the push sends only
what the new baseline references — but this machine keeps the bloat until
the gc succeeds.)Step 4: Re-point remotes and backups. The new history is unrelated to
the old, so the first publish must replace it:
A Dolt remote accumulates chunks monotonically: the force-push re-points the
remote’s refs at the squashed chain but deletes nothing, so the remote’s
storage does not shrink. To reclaim the published side too, rebuild the
remote’s data plane from the squashed HEAD with bd dolt remote reset-data
(below), or replace the remote with a fresh path/prefix:
bd dolt remote remove <name>, bd dolt remote add <name> <fresh-url>,
then bd dolt push --force. Every other clone must re-clone after a squash
regardless, so replacing the remote costs nothing extra.
bd dolt remote reset-data replaces a remote’s data plane in place with a
fresh store holding only live chunks. In server mode, restart the Dolt
server right before it (bd dolt stop, then bd dolt start; restart a
server bd does not run yourself), and do not push or pull that remote in
between:
bd dolt remote reset-data <name> --yes
That is how to shrink a git-backed remote (issue data riding your code
remote under refs/dolt/data), where there is no fresh path to pick — the
storage is the git repository itself, and its manifest lists every
historical table file as current, so the full old store stays reachable
even after the force-push. reset-data replaces the remote’s Dolt data refs
with the fresh store; code branches are untouched. On a native file://
remote it clears the store directory and pushes again. It refuses a cloud
or hosted remote (aws://, gs://, dolthub://, …): replace that one as
above.
A file:// remote whose URL does not end in .git (bd dolt remote list
shows file://, not git+file://) and whose directory is a git repository, a
checkout or a bare repository, is not a native file store: Dolt keeps its
files among the repository’s own. Do not run reset-data on such a remote; replace it with a
fresh URL as above. Releases up to and including v1.3.2 clear such a
checkout, .git and every working file included, and report a reset that
leaves a bare repository’s old table files in place; later releases refuse
both.
The restart matters: a running sql-server keeps its view of every git
remote it has used, the force-push above included. Releases up to and
including v1.3.4 delete the remote’s Dolt data refs and then force-push.
Once the refs are deleted under that view, the push through the server
hangs until a read timeout or reports success having written nothing, and
the remote is left without its Dolt data; running reset-data again right
after a restart rebuilds it. Deleting the refs by hand
(git push origin :refs/dolt/data) and force-pushing runs into the same
trap, so use reset-data.Through a server, bd v1.4.0 and later never delete the data refs first:
reset-data pushes the fresh store to a temporary ref and then moves the
data ref to it, so the remote keeps its data until the new store is
complete, and the restart before it does no harm. The move leaves the
server’s view of the remote stale instead: until the server restarts, it
takes the pre-reset store’s table files for present on the remote, so a
push through it can write a manifest naming files the remote no longer
holds, or report a branch as up to date that the remote lacks. So those
releases restart bd’s own server after the move, on the same port (in
shared-server mode, the shared server). Like bd dolt stop, that restart
commits any uncommitted changes in every database the server serves and
briefly interrupts them, which for the shared server includes other
workspaces’ databases. They do not restart any other server, nor bd’s own
while auto-start is off (dolt.auto-start: false,
BEADS_DOLT_AUTO_START=0) or, outside shared-server mode, while
BEADS_DOLT_SERVER_MODE=1 or dolt_server_port declares it externally
managed. reset-data then exits non-zero once the reset is done, naming the
setting for bd’s own server, and --json sets server_restart_required:
restart that server after reset-data returns, before the next push or pull
of that remote, and do not run reset-data again.Step 5: Verify, then re-clone everywhere else. On this machine:
bd doctorbd list -n 5
Every other clone of this database must be re-created from the squashed
remote. Old clones must not pull: the two chains still share the root, so a
pull can “succeed” as a cross-merge that re-anchors the entire old history —
and a later push resurrects the bloat on the squashed remote.Treat sync jobs and writers as separate switches. Re-enable each machine’s
sync job only after that machine has re-cloned — verified, not assumed —
and unfence writers last; unfencing writers must never implicitly restart a
peer’s sync job. One peer syncing from its old clone re-uploads the entire
pre-squash store to the fresh remote.The first push from a re-cloned machine can be far larger than a routine
sync. If that machine’s scheduled sync job enforces a timeout, the capped
push can die mid-upload on every tick, orphaning partial uploads on the
remote — run one manual bd dolt push (no timeout) right after re-cloning
and hand back to the schedule once it completes.
Prevention
High-frequency coordination state lives in unversioned tables precisely so
routine agent traffic does not mint history — claim leases and
wisps —
so bloat at this scale usually means something is writing versioned tables
in a tight loop. Find and fix that writer, watch data-directory growth over time, and
run dolt gc periodically so unreachable garbage never accumulates on top
of reachable history — with an occasional dolt gc --full, since a default
pass is generational and never revisits data an earlier pass moved to the old
generation.
⌘I
{"docsConfig":{"theme":"linden","$schema":"https://mintlify.com/docs.json","name":"Beads Documentation","colors":{"primary":"#2e8555","light":"#3cad6e","dark":"#29784c"},"logo":{"light":"https://mintcdn.com/beads/YXx_fI6ZwwnOb98c/images/logo.svg?fit=max\u0026auto=format\u0026n=YXx_fI6ZwwnOb98c\u0026q=85\u0026s=30d41ea3e997e8f84bd1cb7ade9eaa07","dark":"https://mintcdn.com/beads/YXx_fI6ZwwnOb98c/images/logo.svg?fit=max\u0026auto=format\u0026n=YXx_fI6ZwwnOb98c\u0026q=85\u0026s=30d41ea3e997e8f84bd1cb7ade9eaa07"},"favicon":"https://mintcdn.com/beads/YXx_fI6ZwwnOb98c/images/favicon.svg?fit=max\u0026auto=format\u0026n=YXx_fI6ZwwnOb98c\u0026q=85\u0026s=b6df642d15e33f80a74ec5f1d5689961","navbar":{"links":[{"icon":"github","href":"https://github.com/gastownhall/beads","label":"GitHub"},{"href":"https://www.npmjs.com/package/@beads/bd","label":"npm"}]},"styling":{"latex":false},"background":{"color":{"light":"#f9fbfa","dark":"#0b0e0e"}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"beads","hasAudioNarration":false,"actualSubdomain":"beads","customDomains":["beads.gascity.com"],"gitSource":{"type":"github","owner":"gastownhall","repo":"beads","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b00b171964ab5c3f5ff2f18","clientVersion":"0.0.4271","searchFilterCounts":[{"language":"default","tag":"Reference","count":131},{"language":"default","tag":"CLI Reference","count":119},{"language":"default","tag":"Integrations","count":19},{"language":"default","tag":"Recovery","count":11},{"language":"default","tag":"Core Concepts","count":9},{"language":"default","tag":"Getting Started","count":6},{"language":"default","tag":"Multi-Agent","count":6},{"language":"default","tag":"Workflows","count":6},{"language":"default","tag":"Architecture","count":2},{"language":"default","tag":"Community","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"recovery/history-squash","slug":"/recovery/history-squash","pageMetadata":{"title":"History Bloat","description":"Shed reachable Dolt history that dolt gc cannot reclaim","href":"/recovery/history-squash"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Shed reachable Dolt history that dolt gc cannot reclaim\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Every bead write mints a Dolt commit, and Dolt keeps every byte a reachable\ncommit references — `,_jsx(_components.code,{children:`dolt gc`}),` only reclaims what nothing points to. A\nworkspace that has accumulated months of high-frequency writes can grow far\npast its live data (gigabytes of storage for a few thousand beads) while\n`,_jsx(_components.code,{children:`dolt gc`}),` reclaims nothing, because the entire chain is still reachable from\nyour branch. This runbook squashes that chain to a single baseline commit so\nthe old history becomes collectable, without touching your live data.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`This procedure rewrites history. Every other clone of the database becomes\nunmergeable and must re-clone, and remotes and backups must be re-pointed.\nRun it in a fenced window: all writers stopped `,_jsx(_components.strong,{children:`on every machine that syncs\nthis database`}),`, backup verified first.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`symptoms`,children:`Symptoms`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The Dolt data directory (or its remote/backup) is large and growing while\n`,_jsx(_components.code,{children:`bd stats`}),` shows a modest number of beads`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dolt gc`}),` and `,_jsx(_components.code,{children:`dolt gc --full`}),` reclaim little or nothing`]}),`\n`,_jsx(_components.li,{children:`Cloning or pulling the database is slow far out of proportion to its content`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`diagnosis`,children:`Diagnosis`}),`\n`,_jsxs(_components.p,{children:[`Run these inside the Dolt data directory — `,_jsx(_components.code,{children:`.beads/embeddeddolt/\u003cdatabase>/`}),`\nin embedded mode, `,_jsx(_components.code,{children:`.beads/dolt/\u003cdatabase>/`}),` in server mode:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# How big is the store?`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`du`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -sh`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# How deep is the history? Thousands of commits with a small live`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# dataset means the history, not the data, is the bloat.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` log`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --oneline`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` wc`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -l`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Confirm gc has nothing unreachable to collect`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` gc`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --full`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`dolt gc --full`}),` frees the space, you are done — no squash needed.`]}),`\n`,_jsx(Heading,{level:`2`,id:`solution`,children:`Solution`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Step 1:`}),` Fence and back up. Stop every writer: agents, background\nservices, and — easiest to miss — any scheduled sync job (cron, launchd,\nsystemd) that pushes or pulls this database, on `,_jsx(_components.em,{children:`every machine that syncs\nit`}),`, not just the one you squash on. List the machines and their sync units\nby name and verify each is stopped. One live peer sync undoes the squash on\nits next tick: it pulls the new baseline, cross-merges it into its old\nchain, and pushes the entire old history back to the fresh remote. In\nserver mode also stop the server after backing up. The backup is dolt-native\nand keeps the full history, so it remains your rollback.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` backup`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sync`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` stop`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Step 2:`}),` Squash to a single baseline. From the Dolt data directory,\nre-commit the current tree directly on top of the root commit. Keeping the\nroot as the sole ancestor preserves a valid chain — do not try to “simplify”\nfurther by starting an orphan branch:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`root`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` log`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --oneline`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` tail`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` cut`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`' '`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -f1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` reset`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --soft`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$root`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -A`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` commit`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -m`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"history squash: baseline $(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`date`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` +%F)\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Step 3:`}),` Drop the other refs and collect. Anything still pointing at the\nold chain keeps it alive — stale local branches and tags, and also the\n`,_jsx(_components.em,{children:`remote-tracking refs`}),` left behind by every past push and fetch, which any\nlong-lived synced workspace has. Delete them all before collecting; Step 4’s\nforce-push recreates the remote-tracking refs on the new chain:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # delete stale branches: dolt branch -D \u003cname>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # delete remote-tracking refs: dolt branch -rd \u003cremote>/\u003cbranch>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tag`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # delete stale tags: dolt tag -d \u003cname>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` gc`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --full`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`du`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -sh`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # verify: the store should now be a fraction of its old size`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`If the size barely moved, a ref still anchors the old chain — re-check\n`,_jsx(_components.code,{children:`dolt branch`}),`, `,_jsx(_components.code,{children:`dolt branch -r`}),`, and `,_jsx(_components.code,{children:`dolt tag`}),` for survivors and collect\nagain. (A failed collection does not endanger Step 4 — the push sends only\nwhat the new baseline references — but this machine keeps the bloat until\nthe gc succeeds.)`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Step 4:`}),` Re-point remotes and backups. The new history is unrelated to\nthe old, so the first publish must replace it:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` push`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --force`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` backup`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` remove`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026 `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` backup`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` init`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`pat`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`h`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # fresh destination, then:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` backup`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sync`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`A Dolt remote accumulates chunks monotonically: the force-push re-points the\nremote’s refs at the squashed chain but deletes nothing, so the `,_jsx(_components.em,{children:`remote’s`}),`\nstorage does not shrink. To reclaim the published side too, rebuild the\nremote’s data plane from the squashed HEAD with `,_jsx(_components.code,{children:`bd dolt remote reset-data`}),`\n(below), or replace the remote with a fresh path/prefix:\n`,_jsx(_components.code,{children:`bd dolt remote remove \u003cname>`}),`, `,_jsx(_components.code,{children:`bd dolt remote add \u003cname> \u003cfresh-url>`}),`,\nthen `,_jsx(_components.code,{children:`bd dolt push --force`}),`. Every other clone must re-clone after a squash\nregardless, so replacing the remote costs nothing extra.`]})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`bd dolt remote reset-data`}),` replaces a remote’s data plane in place with a\nfresh store holding only live chunks. In server mode, restart the Dolt\nserver right before it (`,_jsx(_components.code,{children:`bd dolt stop`}),`, then `,_jsx(_components.code,{children:`bd dolt start`}),`; restart a\nserver bd does not run yourself), and do not push or pull that remote in\nbetween:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dolt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` remote`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` reset-data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`nam`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`e`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --yes`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`That is how to shrink a `,_jsx(_components.em,{children:`git-backed`}),` remote (issue data riding your code\nremote under `,_jsx(_components.code,{children:`refs/dolt/data`}),`), where there is no fresh path to pick — the\nstorage is the git repository itself, and its manifest lists every\nhistorical table file as current, so the full old store stays reachable\neven after the force-push. reset-data replaces the remote’s Dolt data refs\nwith the fresh store; code branches are untouched. On a native `,_jsx(_components.code,{children:`file://`}),`\nremote it clears the store directory and pushes again. It refuses a cloud\nor hosted remote (`,_jsx(_components.code,{children:`aws://`}),`, `,_jsx(_components.code,{children:`gs://`}),`, `,_jsx(_components.code,{children:`dolthub://`}),`, …): replace that one as\nabove.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`file://`}),` remote whose URL does not end in `,_jsx(_components.code,{children:`.git`}),` (`,_jsx(_components.code,{children:`bd dolt remote list`}),`\nshows `,_jsx(_components.code,{children:`file://`}),`, not `,_jsx(_components.code,{children:`git+file://`}),`) and whose directory is a git repository, a\ncheckout or a bare repository, is not a native file store: Dolt keeps its\nfiles among the repository’s own. Do not run reset-data on such a remote; replace it with a\nfresh URL as above. Releases up to and including v1.3.2 clear such a\ncheckout, `,_jsx(_components.code,{children:`.git`}),` and every working file included, and report a reset that\nleaves a bare repository’s old table files in place; later releases refuse\nboth.`]})}),`\n`,_jsxs(_components.p,{children:[`The restart matters: a running sql-server keeps its view of every git\nremote it has used, the force-push above included. Releases up to and\nincluding v1.3.4 delete the remote’s Dolt data refs and then force-push.\nOnce the refs are deleted under that view, the push through the server\nhangs until a read timeout or reports success having written nothing, and\nthe remote is left without its Dolt data; running reset-data again right\nafter a restart rebuilds it. Deleting the refs by hand\n(`,_jsx(_components.code,{children:`git push origin :refs/dolt/data`}),`) and force-pushing runs into the same\ntrap, so use reset-data.`]}),`\n`,_jsxs(_components.p,{children:[`Through a server, bd v1.4.0 and later never delete the data refs first:\nreset-data pushes the fresh store to a temporary ref and then moves the\ndata ref to it, so the remote keeps its data until the new store is\ncomplete, and the restart before it does no harm. The move leaves the\nserver’s view of the remote stale instead: until the server restarts, it\ntakes the pre-reset store’s table files for present on the remote, so a\npush through it can write a manifest naming files the remote no longer\nholds, or report a branch as up to date that the remote lacks. So those\nreleases restart bd’s own server after the move, on the same port (in\nshared-server mode, the shared server). Like `,_jsx(_components.code,{children:`bd dolt stop`}),`, that restart\ncommits any uncommitted changes in every database the server serves and\nbriefly interrupts them, which for the shared server includes other\nworkspaces’ databases. They do not restart any other server, nor bd’s own\nwhile auto-start is off (`,_jsx(_components.code,{children:`dolt.auto-start: false`}),`,\n`,_jsx(_components.code,{children:`BEADS_DOLT_AUTO_START=0`}),`) or, outside shared-server mode, while\n`,_jsx(_components.code,{children:`BEADS_DOLT_SERVER_MODE=1`}),` or `,_jsx(_components.code,{children:`dolt_server_port`}),` declares it externally\nmanaged. reset-data then exits non-zero once the reset is done, naming the\nsetting for bd’s own server, and `,_jsx(_components.code,{children:`--json`}),` sets `,_jsx(_components.code,{children:`server_restart_required`}),`:\nrestart that server after reset-data returns, before the next push or pull\nof that remote, and do not run reset-data again.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Step 5:`}),` Verify, then re-clone everywhere else. On this machine:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` doctor`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -n`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 5`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Every other clone of this database must be re-created from the squashed\nremote. Old clones must not pull: the two chains still share the root, so a\npull can “succeed” as a cross-merge that re-anchors the entire old history —\nand a later push resurrects the bloat on the squashed remote.`}),`\n`,_jsxs(_components.p,{children:[`Treat sync jobs and writers as separate switches. Re-enable each machine’s\nsync job only after `,_jsx(_components.em,{children:`that machine`}),` has re-cloned — verified, not assumed —\nand unfence writers last; unfencing writers must never implicitly restart a\npeer’s sync job. One peer syncing from its old clone re-uploads the entire\npre-squash store to the fresh remote.`]}),`\n`,_jsxs(_components.p,{children:[`The first push from a re-cloned machine can be far larger than a routine\nsync. If that machine’s scheduled sync job enforces a timeout, the capped\npush can die mid-upload on every tick, orphaning partial uploads on the\nremote — run one manual `,_jsx(_components.code,{children:`bd dolt push`}),` (no timeout) right after re-cloning\nand hand back to the schedule once it completes.`]}),`\n`,_jsx(Heading,{level:`2`,id:`prevention`,children:`Prevention`}),`\n`,_jsxs(_components.p,{children:[`High-frequency coordination state lives in unversioned tables precisely so\nroutine agent traffic does not mint history — claim leases and\n`,_jsx(_components.a,{href:`/workflows/wisps`,children:`wisps`}),` —\nso bloat at this scale usually means something is writing versioned tables\nin a tight loop. Find and fix that writer, watch data-directory growth over time, and\nrun `,_jsx(_components.code,{children:`dolt gc`}),` periodically so unreachable garbage never accumulates on top\nof reachable history — with an occasional `,_jsx(_components.code,{children:`dolt gc --full`}),`, since a default\npass is generational and never revisits data an earlier pass moved to the old\ngeneration.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"History Bloat","description":"Shed reachable Dolt history that dolt gc cannot reclaim","href":"/recovery/history-squash"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Symptoms","slug":"symptoms","depth":2,"children":[]},{"title":"Diagnosis","slug":"diagnosis","depth":2,"children":[]},{"title":"Solution","slug":"solution","depth":2,"children":[]},{"title":"Prevention","slug":"prevention","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"beads","siteName":"Beads Documentation","title":"History Bloat - Beads Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-04T12:51:04.820Z","originalFileLocation":"recovery/history-squash.md"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Shed reachable Dolt history that dolt gc cannot reclaim\">\u003cmeta data-mint-head name=\"application-name\" content=\"Beads Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"History Bloat - Beads Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Shed reachable Dolt history that dolt gc cannot reclaim\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Beads Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://beads.gascity.com/recovery/history-squash\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://beads.mintlify.site/_mintlify/api/og/v2?division=Recovery\u0026amp;title=History+Bloat\u0026amp;description=Shed+reachable+Dolt+history+that+dolt+gc+cannot+reclaim\u0026amp;theme=6834af2a4bd690d76b0e1ab8\u0026amp;signature=ae93833db11c5528931e6ba161c4ee742bb2fc9aa19d616e0963e3745ada38cc\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"History Bloat - Beads Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Shed reachable Dolt history that dolt gc cannot reclaim\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://beads.mintlify.site/_mintlify/api/og/v2?division=Recovery\u0026amp;title=History+Bloat\u0026amp;description=Shed+reachable+Dolt+history+that+dolt+gc+cannot+reclaim\u0026amp;theme=6834af2a4bd690d76b0e1ab8\u0026amp;signature=ae93833db11c5528931e6ba161c4ee742bb2fc9aa19d616e0963e3745ada38cc\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/beads/cJ_miYdT2liAG70b/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Beads Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2e8555\">\u003clink data-mint-head rel=\"canonical\" href=\"https://beads.gascity.com/recovery/history-squash\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/recovery/history-squash.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://beads.gascity.com/#organization\",\"name\":\"Beads Documentation\",\"url\":\"https://beads.gascity.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/beads/YXx_fI6ZwwnOb98c/images/logo.svg?fit=max\u0026auto=format\u0026n=YXx_fI6ZwwnOb98c\u0026q=85\u0026s=30d41ea3e997e8f84bd1cb7ade9eaa07\"}},{\"@type\":\"WebSite\",\"@id\":\"https://beads.gascity.com#website\",\"name\":\"Beads Documentation\",\"url\":\"https://beads.gascity.com\",\"publisher\":{\"@id\":\"https://beads.gascity.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://beads.gascity.com/recovery/history-squash#webpage\",\"url\":\"https://beads.gascity.com/recovery/history-squash\",\"name\":\"History Bloat\",\"description\":\"Shed reachable Dolt history that dolt gc cannot reclaim\",\"dateModified\":\"2026-11-04T12:51:04.820Z\",\"isPartOf\":{\"@id\":\"https://beads.gascity.com#website\"},\"breadcrumb\":{\"@id\":\"https://beads.gascity.com/recovery/history-squash#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://beads.gascity.com/recovery/history-squash#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Recovery\",\"item\":\"https://beads.gascity.com/recovery\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"History Bloat\",\"item\":\"https://beads.gascity.com/recovery/history-squash\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://beads.gascity.com/recovery/history-squash#article\",\"headline\":\"History Bloat\",\"name\":\"History Bloat\",\"description\":\"Shed reachable Dolt history that dolt gc cannot reclaim\",\"url\":\"https://beads.gascity.com/recovery/history-squash\",\"mainEntityOfPage\":{\"@id\":\"https://beads.gascity.com/recovery/history-squash#webpage\"},\"dateModified\":\"2026-11-04T12:51:04.820Z\",\"publisher\":{\"@id\":\"https://beads.gascity.com/#organization\"},\"isPartOf\":{\"@id\":\"https://beads.gascity.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Beads Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Beads Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/recovery/history-squash.md","siteName":"Beads Documentation","nav":{"global":null,"groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/index"},{"title":"Installation","href":"/getting-started/installation"},{"title":"Quick Start","href":"/getting-started/quickstart"},{"title":"IDE Setup","href":"/getting-started/ide-setup"},{"title":"Sync Setup Guide","href":"/getting-started/sync-setup"},{"title":"Upgrading","href":"/getting-started/upgrading"}]},{"group":"Core Concepts","pages":[{"title":"How Beads Works","href":"/core-concepts/index"},{"title":"Issues \u0026 Dependencies","href":"/core-concepts/issues"},{"title":"Dependencies and Gates","href":"/core-concepts/dependencies"},{"title":"Hash-based IDs","href":"/core-concepts/hash-ids"},{"title":"Adaptive ID Length","href":"/core-concepts/adaptive-ids"},{"title":"Graph Links in Beads","href":"/core-concepts/graph-links"},{"title":"Sync Concepts","href":"/core-concepts/sync-concepts"},{"title":"Labels","href":"/core-concepts/labels"},{"title":"Issue Metadata","href":"/core-concepts/metadata"}]},{"group":"Architecture","pages":[{"title":"Architecture Overview","href":"/architecture/index"},{"title":"Dolt Backend for Beads","href":"/architecture/dolt"}]},{"group":"Workflows","pages":[{"title":"Workflows","href":"/workflows/index"},{"title":"Molecules","href":"/workflows/molecules"},{"title":"Formulas","href":"/workflows/formulas"},{"title":"Gates","href":"/workflows/gates"},{"title":"Wisps","href":"/workflows/wisps"},{"title":"TODO Command","href":"/workflows/todo"}]},{"group":"Recovery","pages":[{"title":"Recovery Overview","href":"/recovery/index"},{"title":"Accidental v1.2.1 Release","href":"/recovery/accidental-1-2-1-release"},{"title":"Recovery Playbooks","href":"/recovery/init-safety"},{"title":"Database Corruption","href":"/recovery/database-corruption"},{"title":"Schema-Encoding Drift","href":"/recovery/schema-encoding-drift"},{"title":"Merge Conflicts","href":"/recovery/merge-conflicts"},{"title":"Circular Dependencies","href":"/recovery/circular-dependencies"},{"title":"Sync Failures","description":"Recover from Dolt sync failures","href":"/recovery/sync-failures"},{"title":"History Bloat","href":"/recovery/history-squash"},{"title":"Un-migrate from Schema v65","description":"Move a database that bd 1.2.x auto-migrated back to a 1.1.2-compatible workspace, keeping all data","href":"/recovery/unmigrate-schema-v65"},{"title":"Uninstalling","href":"/recovery/uninstalling"}]},{"group":"Multi-Agent","pages":[{"title":"Multi-Agent","href":"/multi-agent/index"},{"title":"Multi-Repo Routing","href":"/multi-agent/routing"},{"title":"Agent Coordination","href":"/multi-agent/coordination"},{"title":"Federation Setup Guide","href":"/multi-agent/federation"},{"title":"Bucket Federation Quickstart","href":"/multi-agent/bucket-federation"},{"title":"Multi-Repo Migration Guide","href":"/multi-agent/multi-repo-migration"}]},{"group":"Integrations","pages":[{"title":"Integrations","href":"/integrations/index"},{"title":"Aider","href":"/integrations/aider"},{"title":"Claude Code","href":"/integrations/claude-code"},{"title":"Beads Claude Code Plugin","href":"/integrations/claude-code-plugin"},{"title":"Codex","href":"/integrations/codex"},{"title":"Sourcegraph Cody","href":"/integrations/cody"},{"title":"Cursor","href":"/integrations/cursor"},{"title":"Factory.ai Droid","href":"/integrations/factory"},{"title":"Gemini CLI","href":"/integrations/gemini"},{"title":"Junie","href":"/integrations/junie"},{"title":"Kilo Code","href":"/integrations/kilocode"},{"title":"Kiro CLI","href":"/integrations/kiro"},{"title":"Mux","href":"/integrations/mux"},{"title":"OpenCode","href":"/integrations/opencode"},{"title":"Windsurf","href":"/integrations/windsurf"},{"title":"MCP Server","href":"/integrations/mcp-server"},{"title":"GitHub Copilot","href":"/integrations/github-copilot"},{"title":"GitHub Copilot CLI Integration Design","href":"/integrations/copilot-cli"},{"title":"Azure DevOps (ADO) Integration Configuration","href":"/integrations/azure-devops"}]},{"group":"Community","pages":[{"title":"Community Tools","href":"/community-tools"},{"title":"Related Projects","href":"/related-projects"}]},{"group":"Reference","pages":[{"title":"Reference","href":"/reference/index"},{"title":"Configuration","href":"/reference/configuration"},{"title":"Git Integration","href":"/reference/git-integration"},{"title":"Git Worktrees Guide","href":"/reference/worktrees"},{"title":"Protected Branches","href":"/reference/protected-branches"},{"title":"Advanced Features","href":"/reference/advanced"},{"title":"JSON Output Schema Contract","href":"/reference/json-schema"},{"title":"Events Journal","href":"/reference/events-journal"},{"title":"Observability (OpenTelemetry)","href":"/reference/observability"},{"title":"Troubleshooting","href":"/reference/troubleshooting"},{"title":"Antivirus False Positives","href":"/reference/antivirus"},{"title":"FAQ","href":"/reference/faq"},{"group":"CLI Reference","pages":[{"title":"CLI Reference","href":"/cli-reference/index"},{"title":"bd admin","href":"/cli-reference/admin"},{"title":"bd ado","href":"/cli-reference/ado"},{"title":"bd assign","href":"/cli-reference/assign"},{"title":"bd audit","href":"/cli-reference/audit"},{"title":"bd backup","href":"/cli-reference/backup"},{"title":"bd batch","href":"/cli-reference/batch"},{"title":"bd blocked","href":"/cli-reference/blocked"},{"title":"bd bootstrap","href":"/cli-reference/bootstrap"},{"title":"bd branch","href":"/cli-reference/branch"},{"title":"bd children","href":"/cli-reference/children"},{"title":"bd close","href":"/cli-reference/close"},{"title":"bd comment","href":"/cli-reference/comment"},{"title":"bd comments","href":"/cli-reference/comments"},{"title":"bd compact","href":"/cli-reference/compact"},{"title":"bd completion","href":"/cli-reference/completion"},{"title":"bd config","href":"/cli-reference/config"},{"title":"bd conflicts","href":"/cli-reference/conflicts"},{"title":"bd context","href":"/cli-reference/context"},{"title":"bd cook","href":"/cli-reference/cook"},{"title":"bd count","href":"/cli-reference/count"},{"title":"bd create-form","href":"/cli-reference/create-form"},{"title":"bd create","href":"/cli-reference/create"},{"title":"bd defer","href":"/cli-reference/defer"},{"title":"bd delete","href":"/cli-reference/delete"},{"title":"bd dep","href":"/cli-reference/dep"},{"title":"bd diff","href":"/cli-reference/diff"},{"title":"bd doctor","href":"/cli-reference/doctor"},{"title":"bd dolt","href":"/cli-reference/dolt"},{"title":"bd duplicate","href":"/cli-reference/duplicate"},{"title":"bd duplicates","href":"/cli-reference/duplicates"},{"title":"bd edit","href":"/cli-reference/edit"},{"title":"bd epic","href":"/cli-reference/epic"},{"title":"bd events","href":"/cli-reference/events"},{"title":"bd export","href":"/cli-reference/export"},{"title":"bd federation","href":"/cli-reference/federation"},{"title":"bd find-duplicates","href":"/cli-reference/find-duplicates"},{"title":"bd flatten","href":"/cli-reference/flatten"},{"title":"bd forget","href":"/cli-reference/forget"},{"title":"bd formula","href":"/cli-reference/formula"},{"title":"bd gate","href":"/cli-reference/gate"},{"title":"bd gc","href":"/cli-reference/gc"},{"title":"bd github","href":"/cli-reference/github"},{"title":"bd gitlab","href":"/cli-reference/gitlab"},{"title":"bd graph","href":"/cli-reference/graph"},{"title":"bd heartbeat","href":"/cli-reference/heartbeat"},{"title":"bd history","href":"/cli-reference/history"},{"title":"bd hooks","href":"/cli-reference/hooks"},{"title":"bd human","href":"/cli-reference/human"},{"title":"bd import","href":"/cli-reference/import"},{"title":"bd info","href":"/cli-reference/info"},{"title":"bd init-safety","href":"/cli-reference/init-safety"},{"title":"bd init","href":"/cli-reference/init"},{"title":"bd jira","href":"/cli-reference/jira"},{"title":"bd kv","href":"/cli-reference/kv"},{"title":"bd label","href":"/cli-reference/label"},{"title":"bd linear","href":"/cli-reference/linear"},{"title":"bd link","href":"/cli-reference/link"},{"title":"bd lint","href":"/cli-reference/lint"},{"title":"bd list","href":"/cli-reference/list"},{"title":"bd mail","href":"/cli-reference/mail"},{"title":"bd memories","href":"/cli-reference/memories"},{"title":"bd merge-slot","href":"/cli-reference/merge-slot"},{"title":"bd metrics","href":"/cli-reference/metrics"},{"title":"bd migrate-personal","href":"/cli-reference/migrate-personal"},{"title":"bd migrate","href":"/cli-reference/migrate"},{"title":"bd mol","href":"/cli-reference/mol"},{"title":"bd note","href":"/cli-reference/note"},{"title":"bd notion","href":"/cli-reference/notion"},{"title":"bd onboard","href":"/cli-reference/onboard"},{"title":"bd orphans","href":"/cli-reference/orphans"},{"title":"bd ping","href":"/cli-reference/ping"},{"title":"bd preflight","href":"/cli-reference/preflight"},{"title":"bd prime","href":"/cli-reference/prime"},{"title":"bd priority","href":"/cli-reference/priority"},{"title":"bd promote","href":"/cli-reference/promote"},{"title":"bd provenance","href":"/cli-reference/provenance"},{"title":"bd prune","href":"/cli-reference/prune"},{"title":"bd purge","href":"/cli-reference/purge"},{"title":"bd q","href":"/cli-reference/q"},{"title":"bd query","href":"/cli-reference/query"},{"title":"bd quickstart","href":"/cli-reference/quickstart"},{"title":"bd ready","href":"/cli-reference/ready"},{"title":"bd recall","href":"/cli-reference/recall"},{"title":"bd reclaim","href":"/cli-reference/reclaim"},{"title":"bd recompute-blocked","href":"/cli-reference/recompute-blocked"},{"title":"bd remember","href":"/cli-reference/remember"},{"title":"bd rename-prefix","href":"/cli-reference/rename-prefix"},{"title":"bd rename","href":"/cli-reference/rename"},{"title":"bd reopen","href":"/cli-reference/reopen"},{"title":"bd repo","href":"/cli-reference/repo"},{"title":"bd restore","href":"/cli-reference/restore"},{"title":"bd rules","href":"/cli-reference/rules"},{"title":"bd schema","href":"/cli-reference/schema"},{"title":"bd search","href":"/cli-reference/search"},{"title":"bd serve","href":"/cli-reference/serve"},{"title":"bd set-state","href":"/cli-reference/set-state"},{"title":"bd setup","href":"/cli-reference/setup"},{"title":"bd ship","href":"/cli-reference/ship"},{"title":"bd show","href":"/cli-reference/show"},{"title":"bd sql","href":"/cli-reference/sql"},{"title":"bd stale","href":"/cli-reference/stale"},{"title":"bd state","href":"/cli-reference/state"},{"title":"bd status","href":"/cli-reference/status"},{"title":"bd statuses","href":"/cli-reference/statuses"},{"title":"bd supersede","href":"/cli-reference/supersede"},{"title":"bd swarm","href":"/cli-reference/swarm"},{"title":"bd sync","href":"/cli-reference/sync"},{"title":"bd tag","href":"/cli-reference/tag"},{"title":"bd todo","href":"/cli-reference/todo"},{"title":"bd types","href":"/cli-reference/types"},{"title":"bd unclaim","href":"/cli-reference/unclaim"},{"title":"bd undefer","href":"/cli-reference/undefer"},{"title":"bd update","href":"/cli-reference/update"},{"title":"bd upgrade","href":"/cli-reference/upgrade"},{"title":"bd vc","href":"/cli-reference/vc"},{"title":"bd version","href":"/cli-reference/version"},{"title":"bd where","href":"/cli-reference/where"},{"title":"bd worktree","href":"/cli-reference/worktree"}]}]}]},"basePath":"","title":"History Bloat - Beads Documentation","deploymentId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","buildId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","dynamics":[],"chunks":[]}