Skip to content

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

Open
@yuerdong

Description

@yuerdong

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions