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

bug: In bpm_bench.cpp, two get_threads may check the consistency of the same page. #758

Open
yuerdong opened this issue Oct 11, 2024 · 0 comments

Comments

@yuerdong
Copy link

auto page_idx = std::min(rand / get_thread_n * get_thread_n + thread_id, bustub_page_cnt - 1);

If bustub_page_cnt is not divisible by get_thread_n, this line may cause two different threads getting the same page_id. As a result, bpm_bench may report "page seed not consistent", despite the fact that the buffer pool is implemented correctly. I have passed all the tests on gradescope, but bpm_bench fails once I change get_thread_n from 8 to 9.

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

No branches or pull requests

1 participant