Commit 0057dab1 authored by marko's avatar marko

branches/zip: Non-functional change: Add some debug assertions and comments.

buf_page_t: Note that the LRU fields are protected by buf_pool_mutex
only, not block->mutex or buf_pool_zip_mutex.

buf_page_get_freed_page_clock(): Note that this is sometimes invoked
without mutex protection.

buf_pool_get_oldest_modification(): Note that the result may be out of
date.

buf_page_get_LRU_position(), buf_page_is_old(): Assert that the buffer
pool mutex is being held.

buf_page_release(): Assert that dirty blocks are in the flush list.
parent 3b798cf6
......@@ -1053,7 +1053,8 @@ struct buf_page_struct{
not yet been flushed on disk; zero if
all modifications are on disk */
/* 3. LRU replacement algorithm fields; protected by buf_pool_mutex */
/* 3. LRU replacement algorithm fields; protected by
buf_pool_mutex only (not buf_pool_zip_mutex or block->mutex) */
UT_LIST_NODE_T(buf_page_t) LRU;
/* node of the LRU list */
......
......@@ -20,6 +20,7 @@ buf_page_get_freed_page_clock(
/* out: freed_page_clock */
const buf_page_t* bpage) /* in: block */
{
/* This is sometimes read without holding buf_pool_mutex. */
return(bpage->freed_page_clock);
}
......@@ -89,6 +90,9 @@ buf_pool_get_oldest_modification(void)
buf_pool_mutex_exit();
/* The returned answer may be out of date: the flush_list can
change after the mutex has been released. */
return(lsn);
}
......@@ -261,6 +265,7 @@ buf_page_get_LRU_position(
const buf_page_t* bpage) /* in: control block */
{
ut_ad(buf_page_in_file(bpage));
ut_ad(buf_pool_mutex_own());
return(bpage->LRU_position);
}
......@@ -429,6 +434,7 @@ buf_page_is_old(
const buf_page_t* bpage) /* in: control block */
{
ut_ad(buf_page_in_file(bpage));
ut_ad(buf_pool_mutex_own());
return(bpage->old);
}
......@@ -1041,6 +1047,10 @@ buf_page_release(
#endif
block->page.buf_fix_count--;
/* Dirty blocks should be in the flush list. */
ut_ad(!block->page.oldest_modification
|| block->page.in_flush_list);
mutex_exit(&block->mutex);
if (rw_latch == RW_S_LATCH) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment