Buffer Manager Test Page

The buffer manager reads disk pages into a main memory page as needed. The collection of main memory pages (called frames) used by the buffer manager for this purpose is called the buffer pool. This is just an array of Page objects. The buffer manager is used by access methods, heap files and relational operators to read/write/allocate/deallocate pages. A run of pages can be allocated with a single call. The Buffer Manager uses the interface to the underlying DB class object which actually performs these functions on disk pages.

Test 1

All normal operations are checked here. A run of pages is allocated, each page in the run is written upon and then unpinned (with the dirty flag set to TRUE). Later, each page is pinned again and the data on each page is compared with the data written on it (obviously, it has to be the same). Finally, all the pages are freed.

Test 2

Test 2 does some illegal buffer manager operations. First, it tries to pin more pages than there are frames in the buffer pool. This operation should fail. It also tries to free a pinned page, and tries to unpin an already unpinned page. Again, these operations should fail.

Test 3

Test 3 allocates several new pages, dirties them and randomly leaves some of them pinned. All the newly allocated pages are pinned again, which means some of the pages are doubly pinned. Data written on them is checked and then all the pages are unpinned.

Buffer Manager Page
Back to the Components Page
Back to the Minibase Home Page