diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2018-03-13 15:20:00 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2018-03-13 15:25:38 +0530 |
commit | 76ae6e725d647fae8a00e0cac71cdc73f66e41d0 (patch) | |
tree | cef15c820b9c9f9bd6513a8ec8dbb8ca06556532 /storage/innobase/buf/buf0flu.cc | |
parent | ff909acfa4e2ebad430db4af2bb86cc4ab6fb6c8 (diff) | |
download | mariadb-git-76ae6e725d647fae8a00e0cac71cdc73f66e41d0.tar.gz |
MDEV-15384 buf_flush_LRU_list_batch() always reports n->flushed=0, n->evicted=0
- buf_flush_LRU_list_batch() initializes the count to zero and updates them
correctly.
Diffstat (limited to 'storage/innobase/buf/buf0flu.cc')
-rw-r--r-- | storage/innobase/buf/buf0flu.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 24b27d7462c..aa982ba0bdc 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -1631,8 +1631,6 @@ buf_flush_LRU_list_batch( { buf_page_t* bpage; ulint scanned = 0; - ulint evict_count = 0; - ulint count = 0; ulint free_len = UT_LIST_GET_LEN(buf_pool->free); ulint lru_len = UT_LIST_GET_LEN(buf_pool->LRU); ulint withdraw_depth = 0; @@ -1648,7 +1646,7 @@ buf_flush_LRU_list_batch( } for (bpage = UT_LIST_GET_LAST(buf_pool->LRU); - bpage != NULL && count + evict_count < max + bpage != NULL && n->flushed + n->evicted < max && free_len < srv_LRU_scan_depth + withdraw_depth && lru_len > BUF_LRU_MIN_LEN; ++scanned, @@ -1666,7 +1664,7 @@ buf_flush_LRU_list_batch( clean and is not IO-fixed or buffer fixed. */ mutex_exit(block_mutex); if (buf_LRU_free_page(bpage, true)) { - ++evict_count; + ++n->evicted; } } else if (buf_flush_ready_for_flush(bpage, BUF_FLUSH_LRU)) { /* Block is ready for flush. Dispatch an IO @@ -1674,7 +1672,7 @@ buf_flush_LRU_list_batch( free list in IO completion routine. */ mutex_exit(block_mutex); buf_flush_page_and_try_neighbors( - bpage, BUF_FLUSH_LRU, max, &count); + bpage, BUF_FLUSH_LRU, max, &n->flushed); } else { /* Can't evict or dispatch this block. Go to previous. */ @@ -1698,12 +1696,12 @@ buf_flush_LRU_list_batch( ut_ad(buf_pool_mutex_own(buf_pool)); - if (evict_count) { + if (n->evicted) { MONITOR_INC_VALUE_CUMULATIVE( MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE, MONITOR_LRU_BATCH_EVICT_COUNT, MONITOR_LRU_BATCH_EVICT_PAGES, - evict_count); + n->evicted); } if (scanned) { @@ -2160,16 +2158,16 @@ buf_flush_lists( failure. */ success = false; - continue; } + + n_flushed += n.flushed; } if (n_flushed) { buf_flush_stats(n_flushed, 0); - } - - if (n_processed) { - *n_processed = n_flushed; + if (n_processed) { + *n_processed = n_flushed; + } } return(success); |