Skip to main content
← Back to list
01Issue
FeatureClosedUAT
AssigneesNone

#256 UAT: swamp datastore compact reclaims WAL and catalog space

Opened by stack72 · 5/5/2026

User journey: An operator notices their .swamp/data/_catalog.db has grown significantly after running many GC cycles. They want to reclaim disk space without disrupting active workflows.

Scenarios

Scenario 1: Run datastore compact on a live datastore

  1. Set up a datastore with several models that have accumulated version history and run swamp data gc a few times to generate WAL writes
  2. Note the size of .swamp/data/_catalog.db and the WAL file (.swamp/data/_catalog.db-wal)
  3. Run swamp datastore compact
  4. Verify the WAL file is truncated to 0 bytes
  5. Verify the catalog DB has shrunk (VACUUM reclaims freed pages)
  6. Verify log output shows "WAL checkpointed and truncated" and "Catalog compacted: reclaimed N bytes"

Scenario 2: JSON output mode

  1. Run swamp datastore compact --json
  2. Verify JSON output contains walPagesTotal, walPagesCheckpointed, dbBytesReclaimed

Scenario 3: Already-compact catalog

  1. Run swamp datastore compact twice in a row
  2. Second run should show "Catalog already compact" (dbBytesReclaimed = 0)

Scenario 4: GC automatically compacts WAL

  1. Run swamp data gc --confirm
  2. Verify log output includes "WAL checkpointed and truncated" at end of GC
  3. Verify WAL file is 0 bytes after GC completes
02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

5/6/2026, 9:34:48 PM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

stack72 commented 5/6/2026, 9:34:46 PM

Sign in to post a ripple.