Master the fundamental concepts of build a simple key-value store through this focused micro-challenge.
The WAL records memtable inserts before they are durable in SSTables. After crash, reopen the log, redo entries since the last checkpoint, and rebuild in-memory state. ARIES formalizes this as analysis, redo, undo phases in larger systems.
Scan WAL sequentially, validate checksums, apply idempotent redo to memtable, then mark checkpoint.
cLoading…
Keep the relevant documentation open while you implement. When your output disagrees with the reference, trace one failing case by hand before changing random lines.
You will implement WAL replay that restores memtable contents after simulated crash. This exercise asks you to skip records before the checkpoint LSN and verify recovered key set.
Document one invariant you will assert in tests and how you would detect its violation from observable symptoms.
Write a C program that implements crash recovery for a key-value store using WAL.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github