Skip to content

Add COW storage lifecycle diagnostics#15

Merged
JanJakes merged 1 commit into
trunkfrom
codex/cow-storage-lifecycle
May 6, 2026
Merged

Add COW storage lifecycle diagnostics#15
JanJakes merged 1 commit into
trunkfrom
codex/cow-storage-lifecycle

Conversation

@adamziel
Copy link
Copy Markdown
Contributor

@adamziel adamziel commented May 5, 2026

What it does

Adds forkpress storage compact for macOS APFS sparsebundle-backed COW sites and expands forkpress storage status with branch/storage roots, lock paths, branch counts, and interrupted-operation leftovers.

This is stacked on #14.

Rationale

Sparsebundle-backed sites need a single ForkPress-managed way to stop the site, detach storage, reclaim free image bands, and explain what is still attached or left behind. Direct hdiutil/rm -rf workflows are too easy to get wrong while a server or branch mutation is active.

Implementation

storage compact stops this site's server unless --keep-server is passed, detaches sparsebundle storage, runs hdiutil compact, and leaves storage detached until forkpress serve or forkpress storage mount.

The COW lifecycle now uses:

  • operations.lock for branch/storage mutations and request exclusion.
  • lifecycle.lock so background server startup and detach/compact cannot race.
  • A locked server registry so read/filter/write operations cannot clobber a concurrently registered server.

The COW E2E now checks lifecycle diagnostics and exercises storage compact; macOS CI runs that path with FORKPRESS_FORCE_MACOS_APFS_SPARSEBUNDLE=1.

Testing instructions

FORKPRESS_RUNTIME_BUNDLE=/dev/null cargo test -p forkpress
make test-all
cargo build --release --target x86_64-unknown-linux-musl -p forkpress
tests/test_cow_strategy_e2e.sh target/x86_64-unknown-linux-musl/release/forkpress

@adamziel adamziel force-pushed the codex/cow-storage-lifecycle branch from 2fb6e8d to 365f00c Compare May 5, 2026 03:28
@JanJakes JanJakes force-pushed the codex/cow-request-operation-locks branch from d210e08 to ae2a48e Compare May 6, 2026 15:52
@JanJakes JanJakes force-pushed the codex/cow-storage-lifecycle branch from 365f00c to 4dc4ef3 Compare May 6, 2026 16:02
@JanJakes JanJakes changed the base branch from codex/cow-request-operation-locks to trunk May 6, 2026 16:02
@JanJakes
Copy link
Copy Markdown
Contributor

JanJakes commented May 6, 2026

Reviewed and recorded follow-up notes under the PR #15 section in issue #30: #30 (comment)

@JanJakes JanJakes merged commit 1df75da into trunk May 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants