Open marvin-j97 opened 4 months ago
Code should never ever deadlock, so if try_lock
fails for the journal rotation and the memtable size is much larger than the configured limit, return an Error::WhatIsGoingOn
(not literally), maybe
Add try_rotate_active_memtable
to lsm-tree
On lock error, check memtable size
If memtable size > 110% * max_memtable_size, we probably have an insert-while-iterate scenario, so return Error::Overpressure [1]
add a unit test with a function that loops forever, inserting stuff while having an iterator open... that function should return Error::Overpressure and not panic or deadlock (as it would now)
[1] Because try_lock may be prevented by open reads, we may need a fair RwLock, so the writers don't starve...
Discussed in https://github.com/fjall-rs/fjall/discussions/73