-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert-during-iterate deadlock #74
Comments
Code should never ever deadlock, so if |
[1] Because try_lock may be prevented by open reads, we may need a fair RwLock, so the writers don't starve... |
Discussed in #73
Originally posted by dbbnrl August 3, 2024
In my application I sometimes generate DB entries from existing entries. The pattern is that I iterate over a range of existing keys, occasionally creating new entries (outside the iterator range) as I go.
It looks like Fjall is deadlocking in this scenario after some number of insertions. I thought perhaps using the snapshot feature would help, but it makes no difference.
Glancing at the code, I can see that
create_iter
takes a bunch of Read locks which it holds until the iterator is dropped. Presumably the insert code is attempting to grab a Write lock at some point (memtable flush?) so this isn't a surprising outcome...I thought about reporting this as an issue but if this kind of usage is an explicit non-goal of Fjall I didn't want to do that.
Is this supported? Supportable?
The text was updated successfully, but these errors were encountered: