{"id":"lsm-wal-truncate-wb-then-ab","text":"`WAL.truncate()` uses a two-open sequence — open in `\"wb\"` mode to truncate the file, then reopen in `\"ab\"` mode for appending — because `\"wb\"` positions the cursor at offset 0 which is unsafe for a WAL","truth_value":"IN","source":"entries/2026/05/29/log-structured-merge-tree-lsm-truncate.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"explanation":{"steps":[{"node":"lsm-wal-truncate-wb-then-ab","truth_value":"IN","reason":"premise"}]}}