bustub icon indicating copy to clipboard operation
bustub copied to clipboard

fix: modify UnpinPage's annotation in buffer_pool_manager.h

Open ZXreaper opened this issue 1 year ago • 4 comments

When I was doing Project #1 - Buffer Pool, according to the error message of Autograder Results, I found that there may be a problem with the annotation of the UnpinPage method in bustub/src/include/buffer/buffer_pool_manager.h. The annotation mentioned "If page_id is not in the buffer pool, return false", but I can't pass the test of the UnpinPage method in gradescope according to this logic, but if the code logic is changed to "If page_id is not in the buffer pool, return true", it will succeed. I think someone should have encountered this problem.

ZXreaper avatar Jun 12 '23 08:06 ZXreaper

I don't think pin count will be < 0 in any case. You should revisit your implementation.

skyzh avatar Jun 12 '23 14:06 skyzh

I don't think pin count will be < 0 in any case. You should revisit your implementation.

Hello, Assistant Professor Chi, I agree with your statement, and the pin count < 0 did not occur when I was doing this project. But I think you seem to have misunderstood what I mean, pin_count<=0 is mentioned in the original annotation, I just deleted the first half sentence in the original annotation, you can check files changed. If I follow the hint in the annotation and return false when page not in page table, I will fail the test on gradescope. I have passed all tests according to my logic now. You can check to see if there is such a problem.

ZXreaper avatar Jun 12 '23 15:06 ZXreaper

Emmm, it seems the result is related to your implementation. The origin doc is right for me.

infdahai avatar Jun 12 '23 18:06 infdahai

Emmm, it seems the result is related to your implementation. The origin doc is right for me.

ok, I will check it, thanks.

ZXreaper avatar Jun 13 '23 01:06 ZXreaper

Closing this PR!

prashanthduvvada avatar Aug 09 '24 09:08 prashanthduvvada