Sled: Sled randomly stucks

Created on 8 Sep 2019  路  6Comments  路  Source: spacejam/sled

On my machine I found sled can randomly stuck during various operations including len, insert and iterating with iter. CPU usage will hike to 100%, but no errors are reported. It seems that printing more logs (either with eprintln or env_logger) makes it more likely to stall.

In one of the cases where I try to iterate through all the key-value pairs in a database, the iterator eventually goes into an infinite loop and keeps visiting two kv pairs in a circle.

Any ideas about why that might happen? I'm using Rust 2018 with rustc nightly-2019-05-22 on Linux.

bug

Most helpful comment

0.28 is out which I believe fixes the issue. Please re-open this if your issue is not resolved, as I think this one is pretty high priority!

All 6 comments

I'm about to release sled 0.27 that addresses one deadlock issue, but I don't know if it's the one you're encountering. It would be quite helpful if you could give me the stacktraces for the threads on your system when you hit a possible deadlock, so I can tell you if it's the same one that is already fixed and about to be released.

I have not encountered the infinite iterator bug before but that's quite serious, are you able to provide a code sample that reproduces the issue? I would love to debug that one!

My codebase is quite complicated. I will try to get a minimal working example. Meanwhile, do you think a copy of the database itself (on which I'm experiencing infinite iterators) would help you investigate the issue?

I created a repo containing a Rust program that reproduces the bug. Hope it helps.

@uraj awesome, thanks! This should be easy to fix now :)

about to release sled 0.28 that includes a fix for this issue, which turned out to be a bug in prefix encoding handling of keys longer than 256 bytes long
https://github.com/spacejam/sled/pull/819

0.28 is out which I believe fixes the issue. Please re-open this if your issue is not resolved, as I think this one is pretty high priority!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

goldenMetteyya picture goldenMetteyya  路  3Comments

D1plo1d picture D1plo1d  路  5Comments

rubdos picture rubdos  路  4Comments

spacejam picture spacejam  路  6Comments

thedrow picture thedrow  路  7Comments