{"id":"wal-thread-safety-stranded-by-callers","text":"The WAL carefully serializes all mutations (append, append_batch, checkpoint, truncate) under a threading.Lock, but both callers that depend on it have no synchronization for their own shared state: the LSM tree mutates _memtable, _sstables, and _immutable_memtables without any locking or atomic swaps, and _sstables specifically is mutated by both flush (append) and compact (full replacement) concurrently — the lock protects the log but not the data structures built from it.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["wal-all-mutations-under-lock","lsm-no-synchronization","lsm-sstables-unprotected-mutation"],"outlist":[],"label":"WAL's threading.Lock is the only concurrency protection in the storage stack, but it guards the wrong layer — callers that depend on WAL durability have no protection for their own shared state"}],"dependents":[],"metadata":{"last_reviewed":"2026-05-30T09:01:17","review_result":"insufficient"},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"wal-thread-safety-stranded-by-callers","truth_value":"IN","reason":"SL justification valid","antecedents":["wal-all-mutations-under-lock","lsm-no-synchronization","lsm-sstables-unprotected-mutation"],"label":"WAL's threading.Lock is the only concurrency protection in the storage stack, but it guards the wrong layer — callers that depend on WAL durability have no protection for their own shared state"},{"node":"wal-all-mutations-under-lock","truth_value":"IN","reason":"premise"},{"node":"lsm-no-synchronization","truth_value":"IN","reason":"premise"},{"node":"lsm-sstables-unprotected-mutation","truth_value":"IN","reason":"premise"}]}}