bustub icon indicating copy to clipboard operation
bustub copied to clipboard

BufferPoolManager.NewPage spec is unclear if the pages returned must be pinned

Open sitano opened this issue 6 years ago • 3 comments

It is unclear from the spec if the pages returned from BufferPoolManager.NewPage must be pinned.

Actually, if they are not the test would fail (as any previously allocated page becomes victimized instantly), from what I can conclude they must be?

And of course, it is funny to return a pointer to a newly allocated page which was concurrently evicted even before the method returned.

It is also unclear whether the new page must be marked as dirty.

sitano avatar Oct 16 '19 15:10 sitano

@sitano Do you understand the second test case of buffer_pool_manager_test.cpp?

iwanttobepowerful avatar Sep 05 '20 14:09 iwanttobepowerful

Do you understand the second test case of buffer_pool_manager_test.cpp?

@iwanttbepowerful the TEST(BufferPoolManagerTest, DISABLED_SampleTest) { one?

It that's the one, then yes. Ask what you part you don't.

sitano avatar Sep 07 '20 10:09 sitano

Do you understand the second test case of buffer_pool_manager_test.cpp?

@iwanttbepowerful the TEST(BufferPoolManagerTest, DISABLED_SampleTest) { one?

It that's the one, then yes. Ask what you part you don't.

Hi, bro. Thanks for your reply. I understood the test case.

iwanttobepowerful avatar Sep 08 '20 01:09 iwanttobepowerful

Fixed in this year.

https://github.com/cmu-db/bustub/blob/4df5b13f317c86e1f0058135ede3a219b26f3578/src/include/buffer/buffer_pool_manager_instance.h#L66-L68

skyzh avatar Sep 16 '22 04:09 skyzh