Loading the code workspace…
Write a C program that implements a simplified Write-Ahead Log.
Requirements:
PostgreSQL, MySQL's InnoDB, and SQLite's WAL mode all implement this exact append-log-before-data-page protocol, and PostgreSQL's own WAL format uses the same LSN-per-page scheme this task builds to decide which records need replaying after a crash. Getting the checksum wrong is why real WAL implementations reject a torn or corrupted record instead of silently applying garbage during recovery.