Loading lesson…
Compaction as a durable transaction
DetailedOverviewQuizFlashcard
Compaction as a durable transaction
Build lab: an unchecked compactor commits a verbose 909-token summary of an 894-token transcript (ratio 1.02) and overwrites the original turns in place, while a naive any-shrink (< 1.00) compactor leaks a 536-token treadmill summary (ratio 0.60). Build a four-phase durable transaction (BEGIN -> SUMMARIZE -> VERIFY -> COMMIT | ROLLBACK) that enforces the 0.50 shrink invariant (< 447 tokens), fails closed, and archives the pre-image.
This Harness Engineering lesson is part of a paid plan. Sign in with a plan that includes this course to read it.