Skip to content

feat(gc): LayerFS 2.0 GC implementation (#41, #42–#52) - #696

Closed
mengmengmengqiang wants to merge 1 commit into
layerfs_v2_0_0from
gc-2.0-gc-implementation
Closed

mengmengmengqiang wants to merge 1 commit into
layerfs_v2_0_0from
gc-2.0-gc-implementation

Conversation

@mengmengmengqiang

@mengmengmengqiang mengmengmengqiang commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements the frozen LayerFS 2.0 GC spec (#41, sub-issues #42–#52).

Area What shipped
Schema/migrations marker tables (branch_retired, layer_stack_retired, path_removed), project_epoch, gc_intent, gc_op, gc_dead, kept_node, history_serial/next_history_serial, trace_salt; SQLite + PostgreSQL additive steps
Removals branch.remove (marker, NameTaken, fork syntax, doctor), project.delete (home/worker, sidecar, retry), project.remove_file (visibility-only whiteouts, path grammar, frontier)
Admission gc_intent, MountsActive/Busy/Unresolved, PG advisory keys, project-epoch writer fence
Mark/closure history closure, object/pack closure, keptWaste, live-heads digest
Compaction SQLite: seal, step 1.5, VACUUM INTO, immutable verify, install fence, artifacts, crash/kill recovery. PostgreSQL: Phase M/A/B/C, gc_op/gc_dead, scratch schema, swap, totals, standby/lost reply
Report/status §11 compact report, store.status op/phases (SQLite + PG), bounded metrics/SLO
API/MCP/CLI/SDK 76 calls (38 work / 38 admin), generated CLI/Node/Python surfaces, coverage 76
Tests/CI/docs SQLite + PG suites, real SIGKILL and real CLI-process kill, ext4 CI lane, 50 GB capacity measurement, runbook/rollout/spec-gap docs

Test evidence

  • Default features: layerfs-persistence 271, layerfs-store-service 214, layerfs-store 59 = 544 passed, 0 failed, 18 ignored.
  • SQLite: sqlite_compact 20, sqlite_compact_crash 23 (9 real-process SIGKILL + 8 CLI process-kill arms), sqlite_compact_fixtures 1, sqlite_compact_matrix 1, sqlite_compact_capacity 1.
  • PostgreSQL 17: postgresql_compact 20, postgresql_status 3 + control 1, postgresql_compact_fixtures 5, postgresql_doctor_physical 16, postgresql_position_columns 4, postgresql_open_check 3, postgresql_diagnostic 9, postgresql_doctor_access 10; PG matrix 73 passed.
  • Clippy: cargo clippy -p layerfs-persistence -p layerfs-store-service --all-targets --features postgresql --no-deps -- -D warnings exits 0.
  • Acceptance matrix: 8 executed / 30 covered / 16 partial / 6 deferred (core/docs/issues/project-41/gc-acceptance-matrix.md).

CI note

The base layerfs_v2_0_0 only triggers ci.yml on pushes to main; pull_request workflows live on the base branch, so this PR shows no checks. The new store-ext4.yml lane (quick on PR, full + PostgreSQL 17 on schedule/dispatch) will run after merge. Local evidence above was produced with the same ext4/PG-17 setup.

Known limitations

Related

Sub-issues

Tracks #42–#52 (implementation mapping):

Implements the frozen 2.0 GC spec (#41/#42-#52): marker-based branch/project/path removal, admission (gc_intent), mark/closure (kept_node, object closure, keptWaste, live-heads digest), SQLite and PostgreSQL compaction (Phase M/A/B/C, install fence, crash/kill recovery), §11 report + store.status, metrics, API/MCP/CLI/SDK (76 calls), SQLite/PG tests, ext4 CI harness, capacity model (50GB measured), runbook/rollout docs.
@mengmengmengqiang mengmengmengqiang added api/calls The call table, its checks and the one dispatcher every front end uses core/history LayerStacks, Branches, Commits, Layers and stages: immutable history metadata enhancement labels Nov 15, 2026
@mengmengmengqiang

Copy link
Copy Markdown
Contributor Author

Split by issue into four stacked PRs: #697 (#42-#45), #698 (#46-#47), #699 (#48-#49), #700 (#50-#52). This monolithic PR is superseded; closing to avoid duplicate review.

@mengmengmengqiang
mengmengmengqiang deleted the gc-2.0-gc-implementation branch November 16, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api/calls The call table, its checks and the one dispatcher every front end uses core/history LayerStacks, Branches, Commits, Layers and stages: immutable history metadata enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant