So far, whenever a page is fixed as virgin (method bf_tree_m::_fix_nonswizzled with argument virgin_page = true), the contents were not zeroed out, such that the contents of whatever page was in the same frame before are reused. It should not be a problem, since a page_img_format operation usually follows. However, I've encountered a situation where this can be a problem.
In the implementation of B-tree growth (i.e., adding a new root page), a page is allocated and we use format_steal to copy the contents of the root page into it. This method, however, does not set the page LSN, meaning that the page_img_format log record will use whatever is in there (possibly garbage from an old frame) as its page_prev_lsn. In our tests, this garbage is usually zero anyway, so nothing happens. However, an intense test running with lots of data and a small buffer will eventually encounter the situation where some garbage will be used, leaving the per-page chain inconsistent.
There are two possible fixes:
1) The fix method zeroes the frame contents when virgin_page is given
2) format_steal sets an empty page LSN prior to generating a log record
So far, whenever a page is fixed as virgin (method
bf_tree_m::_fix_nonswizzled
with argumentvirgin_page = true
), the contents were not zeroed out, such that the contents of whatever page was in the same frame before are reused. It should not be a problem, since a page_img_format operation usually follows. However, I've encountered a situation where this can be a problem.In the implementation of B-tree growth (i.e., adding a new root page), a page is allocated and we use
format_steal
to copy the contents of the root page into it. This method, however, does not set the page LSN, meaning that thepage_img_format
log record will use whatever is in there (possibly garbage from an old frame) as itspage_prev_lsn
. In our tests, this garbage is usually zero anyway, so nothing happens. However, an intense test running with lots of data and a small buffer will eventually encounter the situation where some garbage will be used, leaving the per-page chain inconsistent.There are two possible fixes: 1) The fix method zeroes the frame contents when
virgin_page
is given 2)format_steal
sets an empty page LSN prior to generating a log record