-
Notifications
You must be signed in to change notification settings - Fork 485
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
Investigate possible bug in im
crate
#3395
Comments
If you have working version with rpds, then it seems to be quite easy to investigate this bug: just dump located layer in both cases and find the first difference. Do you want me to look at this bug or your prefer to investigate it yourself? |
Yes it could be easy. Or it might get more complicated with the heisenbug mentioned here #2998 (comment) It's very suspicious that Anyway, feel free to steal this task, just let me know (assign it to yourself). I'll work on layer map gc first |
This branch is now removed (once you have merged in in main). Also I wonder about get_prev() method - I failed to find it in TreeMap specification: |
The branch But I created this before a big refactor of the code, so maybe it's easier to start from scratch. Just replace Here's get_prev https://docs.rs/im/latest/im/struct.OrdMap.html#method.get_prev |
I wonder on which test IM is failed? |
See here #2998 (comment) Fails on the checks in the benchmark. Also previously it failed on running pgbench init 10GB 3 times on the same timeline. Not sure if that one was deterministic. |
Which benchmark? bench_layer_map? I was able to run it... And once again I do not see that im is faster:
im:
|
Are you using |
|
No. |
Read #2998 (comment)
|
I think |
If you share a link to your branch I can help reproduce it. |
Nevermind, here's a branch you can use: https://github.com/neondatabase/neon/compare/layer_map_im?expand=1 Just run the benchmarks, and the |
Updated the branch with a tighter assertion. Found that |
Found a shorter sequence of updates that reveals the bug (about 100 updates). See https://github.com/bojanserafimov/im_crate_bug_report Also, I previously thought that |
Reported the bug bodil/im-rs#205 Also given this other issue bodil/im-rs#202 and the lack of response to it, I think it's better to stay with I'm currently running the same fuzz test on |
I tried to step through get_prev() code in debugger.
If key is not found in the children, then no attempt is made to search it in previous children and as a result None is propagated upstairs. |
with the following IM patch layer bench normally completed:
Performance with patched IM and get_prev is the following:
Seems to be not "times" faster I have replaced next_back() only in one place - in |
30%, not 70% (see my comment), on my pc, on most of the microbenchmarks. Mostly vec allocation is what disappeared from the flame graph. If we want more layer map perf, a better place to start is to change the |
If the bug is not in the
im
crate then it's in our layer map so it's good to check. If the bug is in theim
crate, it's good to minimize and report/fixMore context:
Originally posted by @bojanserafimov in #2998 (comment)
The text was updated successfully, but these errors were encountered: