beads/internal/storage/versioncontrolops
matt wilkie bc74f7e897
fix(fetch): run GC after failed DOLT_FETCH to prevent tmp_pack_* accumulation (#3326)
When DOLT_FETCH fails (network error, timeout, authentication), Dolt
leaves orphaned tmp_pack_* files in .dolt/git-remote-cache/. These
accumulate unboundedly across repeated failures and are never cleaned
up automatically.

Observed impact: 194 GB of tmp_pack_* debris on a single machine after
months of failed federation syncs.

Call DoltGC best-effort after a failed fetch so orphaned pack
temporaries are reclaimed before the error propagates. DoltGC requires
a non-transactional connection; if db is a transaction the GC will
fail silently, which is acceptable — the original fetch error is still
returned correctly.

Cherry-picked from #3308 by @athosmartins. The original PR bundled an
unrelated Gas Town schema migration (re-adding the `crystallizes`
column that migration 012 explicitly dropped) and accidentally deleted
a working #nosec directive in rules.go, so this pulls out just the
valuable fix.

Closes bd-fst

Co-authored-by: Athos Bernardes <athosmartins@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 16:01:11 -07:00
..
backup.go fix: suppress auto-backup address conflict warning (#2927) 2026-04-02 20:28:47 -07:00
backup_test.go fix: suppress auto-backup address conflict warning (#2927) 2026-04-02 20:28:47 -07:00
branches.go /{cmd,internal}: wip sync and data EmbeddedDoltStore methods 2026-03-24 12:01:16 -07:00
clone.go /internal/storage: pr feedback 2026-03-26 11:17:39 -07:00
commit.go /{.github,cmd,internal}: pr feedback, ci fix 2026-03-25 12:58:46 -07:00
compact.go /internal/storage: pr feedback 2026-03-26 11:17:39 -07:00
db.go /{cmd,internal}: wip sync and data EmbeddedDoltStore methods 2026-03-24 12:01:16 -07:00
flatten.go /{cmd,internal}: pr feedback 2026-03-25 15:09:54 -07:00
gc.go /{cmd,internal}: fix commands 2026-03-25 13:48:13 -07:00
ignored_tables.go /internal/storage/schema: use shared schema package 2026-04-06 15:03:20 -07:00
remotes.go fix(fetch): run GC after failed DOLT_FETCH to prevent tmp_pack_* accumulation (#3326) 2026-04-17 16:01:11 -07:00
version_control.go /{cmd,internal}: pr feedback 2026-03-25 15:09:54 -07:00