Skip to content

Commit 0fe97c2

Browse files
committed
MDEV-23017: Regression due to unwanted read-ahead
MDEV-15053 inadvertently inverted the condition for invoking buf_read_ahead_linear(). buf_page_get_low(): Apply the correct condition. buf_page_optimistic_get(): Remove the read-ahead altogether. This function should never access a block for the first time.
1 parent 1a4846d commit 0fe97c2

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

storage/innobase/buf/buf0buf.cc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3516,7 +3516,7 @@ buf_page_get_low(
35163516
|| mode == BUF_PEEK_IF_IN_POOL
35173517
|| fix_block->page.status != buf_page_t::FREED);
35183518

3519-
const bool first_access = fix_block->page.set_accessed();
3519+
const bool not_first_access = fix_block->page.set_accessed();
35203520

35213521
if (mode != BUF_PEEK_IF_IN_POOL) {
35223522
buf_page_make_young_if_needed(&fix_block->page);
@@ -3571,7 +3571,7 @@ buf_page_get_low(
35713571
file, line);
35723572
}
35733573

3574-
if (mode != BUF_PEEK_IF_IN_POOL && first_access) {
3574+
if (!not_first_access && mode != BUF_PEEK_IF_IN_POOL) {
35753575
/* In the case of a first access, try to apply linear
35763576
read-ahead */
35773577

@@ -3678,7 +3678,7 @@ buf_page_optimistic_get(
36783678
buf_block_buf_fix_inc(block, file, line);
36793679
hash_lock->read_unlock();
36803680

3681-
const bool first_access = block->page.set_accessed();
3681+
block->page.set_accessed();
36823682

36833683
buf_page_make_young_if_needed(&block->page);
36843684

@@ -3723,13 +3723,6 @@ buf_page_optimistic_get(
37233723
ut_ad(block->page.buf_fix_count());
37243724
ut_ad(block->page.state() == BUF_BLOCK_FILE_PAGE);
37253725

3726-
if (first_access) {
3727-
/* In the case of a first access, try to apply linear
3728-
read-ahead */
3729-
buf_read_ahead_linear(block->page.id(), block->zip_size(),
3730-
ibuf_inside(mtr));
3731-
}
3732-
37333726
buf_pool.stat.n_page_gets++;
37343727

37353728
return(TRUE);

0 commit comments

Comments
 (0)