From 18f374cb20a8d3ec8d8349be40a8659d18ee7678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 12 Aug 2020 13:12:51 +0300 Subject: MDEV-23439 Assertion size == space->size failed in buf_read_ahead_random The debug assertion is bogus, and we had removed it in commit b1ab211dee599eabd9a5b886fafa3adea29ae041 (MDEV-15053) in the MariaDB Server 10.5 branch. For a small data file, fil_space_extend_must_retry() would always allocate a minimum size of 4*innodb_page_size. It is possible that random read-ahead will be triggered for a smaller file than this. In the observed case, the read-ahead was triggered for a 6-page file that used ROW_FORMAT=COMPRESSED with 8KiB page size. So, the desired file size was 49152 bytes, but the actual size was 65536 bytes. --- storage/innobase/buf/buf0rea.cc | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index d6f096fc80e..ad583e577c4 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -280,23 +280,6 @@ buf_read_ahead_random( * buf_read_ahead_random_area; if (fil_space_t* space = fil_space_acquire(page_id.space())) { -#ifdef UNIV_DEBUG - if (srv_file_per_table) { - ulint size = 0; - - for (const fil_node_t* node = - UT_LIST_GET_FIRST(space->chain); - node != NULL; - node = UT_LIST_GET_NEXT(chain, node)) { - - size += ulint(os_file_get_size(node->handle) - / page_size.physical()); - } - - ut_ad(size == space->size); - } -#endif /* UNIV_DEBUG */ - high = space->max_page_number_for_io(high); fil_space_release(space); } else { -- cgit v1.2.1