Skip to content
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

Fix race condition causing an infinite loop in the eviction queue #4187

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

benjaminwinger
Copy link
Collaborator

@benjaminwinger benjaminwinger commented Sep 4, 2024

Other threads may evict all remaining items in the eviction queue while looping looking for the next item to evict.

I suspect this fixes the issues described in #3743, and is not related to #3459, but I haven't checked.

I noticed this when investigating the CI failure in the 256KB page pipeline. It doesn't fix that failure, but does make it a little easier to reproduce as it was hanging sometimes when I tried to reproduce it.

this only actually occurs when the page size and thread count is large enough, and the buffer pool size is small enough, that enough threads try to reserve pages simultaneously and have to evict that the entire eviction queue is cleared; so it would have been extremely rare outside of certain tests

Copy link

github-actions bot commented Sep 4, 2024

Benchmark Result

Master commit hash: 9c88af19c47feca5a807337a7da329880ffee34d
Branch commit hash: b4603662a556f5acea3c9bff56b15d12b18bda65

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 676.92 679.28 -2.36 (-0.35%)
aggregation q28 11097.20 11215.19 -118.00 (-1.05%)
filter q14 153.49 152.75 0.74 (0.49%)
filter q15 154.32 151.17 3.15 (2.08%)
filter q16 332.86 327.41 5.45 (1.67%)
filter q17 481.79 471.99 9.80 (2.08%)
filter q18 1958.41 1948.78 9.63 (0.49%)
fixed_size_expr_evaluator q07 575.10 566.81 8.29 (1.46%)
fixed_size_expr_evaluator q08 788.29 773.91 14.37 (1.86%)
fixed_size_expr_evaluator q09 810.98 773.47 37.51 (4.85%)
fixed_size_expr_evaluator q10 273.85 266.10 7.75 (2.91%)
fixed_size_expr_evaluator q11 269.85 260.98 8.87 (3.40%)
fixed_size_expr_evaluator q12 263.08 258.54 4.54 (1.76%)
fixed_size_expr_evaluator q13 1498.38 1491.74 6.64 (0.45%)
fixed_size_seq_scan q23 146.22 138.72 7.50 (5.41%)
join q31 13.18 13.12 0.06 (0.42%)
ldbc_snb_ic q35 972.21 731.38 240.83 (32.93%)
ldbc_snb_ic q36 49.62 44.80 4.82 (10.76%)
ldbc_snb_is q32 9.00 9.19 -0.19 (-2.11%)
ldbc_snb_is q33 18.74 18.32 0.42 (2.31%)
ldbc_snb_is q34 8.19 8.84 -0.65 (-7.38%)
multi-rel multi-rel-large-scan 2765.51 2856.83 -91.33 (-3.20%)
multi-rel multi-rel-lookup 36.95 44.44 -7.48 (-16.84%)
multi-rel multi-rel-small-scan 52.17 75.71 -23.54 (-31.09%)
order_by q25 159.48 161.00 -1.53 (-0.95%)
order_by q26 484.67 497.28 -12.61 (-2.54%)
order_by q27 1459.95 1448.68 11.27 (0.78%)
scan_after_filter q01 202.37 195.27 7.10 (3.63%)
scan_after_filter q02 190.41 190.69 -0.28 (-0.15%)
shortest_path_ldbc100 q39 74.13 74.67 -0.55 (-0.73%)
var_size_expr_evaluator q03 2106.32 2114.14 -7.83 (-0.37%)
var_size_expr_evaluator q04 2291.81 2329.76 -37.95 (-1.63%)
var_size_expr_evaluator q05 2678.20 2590.56 87.64 (3.38%)
var_size_expr_evaluator q06 1401.40 1440.09 -38.69 (-2.69%)
var_size_seq_scan q19 1490.17 1526.80 -36.63 (-2.40%)
var_size_seq_scan q20 3370.37 3212.89 157.48 (4.90%)
var_size_seq_scan q21 2530.68 2464.63 66.04 (2.68%)
var_size_seq_scan q22 136.69 135.70 0.99 (0.73%)

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.08%. Comparing base (d66a38d) to head (dae250b).
Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4187      +/-   ##
==========================================
- Coverage   84.09%   84.08%   -0.01%     
==========================================
  Files        1332     1332              
  Lines       53250    53252       +2     
  Branches     7428     7428              
==========================================
  Hits        44779    44779              
- Misses       8299     8301       +2     
  Partials      172      172              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benjaminwinger benjaminwinger merged commit d18721d into master Sep 5, 2024
23 of 24 checks passed
@benjaminwinger benjaminwinger deleted the bm-deadlock-fix branch September 5, 2024 09:31
ted-wq-x pushed a commit to ted-wq-x/kuzu that referenced this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants