mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 06:44:16 +01:00
branches/zip: buf_LRU_free_block(): When buf_page_is_old(b), we incremented
buf_pool->LRU_old_len. However, we forgot to check if buf_pool->LRU_old happens to point to b's successor in the LRU list. If it does, we must assign buf_pool->LRU_old = b. The following invariants hold: In the LRU list, the "old" flag should grow monotonically, i.e., it is 0 for the first few items and 1 from thereafter. If buf_pool->LRU_old != NULL, it must point to the first item with old=1 in the LRU list, and there must be buf_pool->LRU_old_len old items in the list. This should fix Mantis issue#50 and issue#68.
This commit is contained in:
parent
9bbd5454db
commit
7d69d45534
2 changed files with 12 additions and 2 deletions
|
@ -1246,6 +1246,12 @@ alloc:
|
|||
|
||||
if (buf_page_is_old(b)) {
|
||||
buf_pool->LRU_old_len++;
|
||||
if (UNIV_UNLIKELY
|
||||
(buf_pool->LRU_old
|
||||
== UT_LIST_GET_NEXT(LRU, b))) {
|
||||
|
||||
buf_pool->LRU_old = b;
|
||||
}
|
||||
}
|
||||
|
||||
lru_len = UT_LIST_GET_LEN(buf_pool->LRU);
|
||||
|
|
|
@ -1277,13 +1277,17 @@ struct buf_pool_struct{
|
|||
/* base node of the LRU list */
|
||||
buf_page_t* LRU_old; /* pointer to the about 3/8 oldest
|
||||
blocks in the LRU list; NULL if LRU
|
||||
length less than BUF_LRU_OLD_MIN_LEN */
|
||||
length less than BUF_LRU_OLD_MIN_LEN;
|
||||
NOTE: when LRU_old != NULL, its length
|
||||
should always equal LRU_old_len */
|
||||
ulint LRU_old_len; /* length of the LRU list from
|
||||
the block to which LRU_old points
|
||||
onward, including that block;
|
||||
see buf0lru.c for the restrictions
|
||||
on this value; not defined if
|
||||
LRU_old == NULL */
|
||||
LRU_old == NULL;
|
||||
NOTE: LRU_old_len must be adjusted
|
||||
whenever LRU_old shrinks or grows! */
|
||||
|
||||
UT_LIST_BASE_NODE_T(buf_block_t) unzip_LRU;
|
||||
/* base node of the unzip_LRU list */
|
||||
|
|
Loading…
Add table
Reference in a new issue