diff --git a/mini-lsm-book/src/week1-01-memtable.md b/mini-lsm-book/src/week1-01-memtable.md index b8685353..5ccb2e83 100644 --- a/mini-lsm-book/src/week1-01-memtable.md +++ b/mini-lsm-book/src/week1-01-memtable.md @@ -214,7 +214,6 @@ Answer the correctness questions with reference to your implementation. For ques * Does it make sense for a memtable to store every write instead of only the latest version of a key? For example, suppose a user writes `a -> 1`, `a -> 2`, and `a -> 3` to the same memtable. * Why do we need a combination of `state` and `state_lock`? Can we only use `state.read()` and `state.write()`? * Construct the smallest example in which probing memtables in the wrong order returns a stale value. Then construct one in which it resurrects a deleted value. -* After a memtable is frozen, could a thread that still holds an old LSM-state snapshot write to that now-immutable memtable? How does your solution prevent this? * In several places, you might acquire a state read lock, release it, and then acquire a write lock. The two operations may occur in different functions that call one another. How does this differ from directly upgrading a read lock to a write lock? Is an upgrade necessary, and what does it cost? ### Performance and Design diff --git a/mini-lsm-book/src/week1-06-write-path.md b/mini-lsm-book/src/week1-06-write-path.md index 258ea5fe..8336156f 100644 --- a/mini-lsm-book/src/week1-06-write-path.md +++ b/mini-lsm-book/src/week1-06-write-path.md @@ -158,6 +158,7 @@ After the tests pass, record the state before and after a manual flush: the muta * What happens if a user requests to delete a key twice? * Why must the state update verify that the memtable removed from `imm_memtables` has the ID used to build the SST? * Construct an interleaving that would corrupt the state if two flushes selected the same oldest memtable without `state_lock`. +* Revisit the Day 1 freeze path: does your `put` hold the state read lock until the memtable write finishes? If it released the lock after saving the memtable `Arc`, could that write land after the memtable was frozen? * For each combination of included, excluded, and unbounded scan bounds, state the condition under which an SST range can be safely excluded. ### Memory and Performance