mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 11:27:39 +02:00
MDEV-37250 buf_pool_t::shrink() assertion failure
buf_pool_t::shrink(): When relocating a dirty page of the temporary tablespace, reset the oldest_modification() on the discarded block, like we do for persistent pages in buf_flush_relocate_on_flush_list(). buf_pool_t::resize(): Add debug assertions to catch this error earlier. This bug does not seem to affect non-debug builds. Reviewed by: Thirunarayanan Balathandayuthapani
This commit is contained in:
parent
a8eeffb0a3
commit
cedfe8eca4
4 changed files with 45 additions and 1 deletions
|
|
@ -0,0 +1,17 @@
|
|||
call mtr.add_suppression("innodb_buffer_pool_size change aborted");
|
||||
SET @b=REPEAT('0',1048576);
|
||||
CREATE TEMPORARY TABLE t (c MEDIUMTEXT) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES
|
||||
(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b);
|
||||
SET STATEMENT max_statement_time=0.000001 FOR
|
||||
SET GLOBAL innodb_buffer_pool_size=6291456;
|
||||
SET STATEMENT max_statement_time=0.000001 FOR
|
||||
SET GLOBAL innodb_buffer_pool_size=6291456;
|
||||
SET STATEMENT max_statement_time=0.000001 FOR
|
||||
SET GLOBAL innodb_buffer_pool_size=6291456;
|
||||
SET GLOBAL innodb_buffer_pool_size=6291456;
|
||||
SET GLOBAL innodb_buffer_pool_size=16777216;
|
||||
CHECKSUM TABLE t;
|
||||
Table Checksum
|
||||
test.t 4050893687
|
||||
DROP TEMPORARY TABLE t;
|
||||
|
|
@ -0,0 +1 @@
|
|||
--innodb-buffer-pool-size=16m
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
--source include/have_innodb.inc
|
||||
call mtr.add_suppression("innodb_buffer_pool_size change aborted");
|
||||
SET @b=REPEAT('0',1048576);
|
||||
CREATE TEMPORARY TABLE t (c MEDIUMTEXT) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES
|
||||
(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b);
|
||||
--error 0,ER_WRONG_USAGE
|
||||
SET STATEMENT max_statement_time=0.000001 FOR
|
||||
SET GLOBAL innodb_buffer_pool_size=6291456;
|
||||
--error 0,ER_WRONG_USAGE
|
||||
SET STATEMENT max_statement_time=0.000001 FOR
|
||||
SET GLOBAL innodb_buffer_pool_size=6291456;
|
||||
--error 0,ER_WRONG_USAGE
|
||||
SET STATEMENT max_statement_time=0.000001 FOR
|
||||
SET GLOBAL innodb_buffer_pool_size=6291456;
|
||||
--error 0,ER_WRONG_USAGE
|
||||
SET GLOBAL innodb_buffer_pool_size=6291456;
|
||||
SET GLOBAL innodb_buffer_pool_size=16777216;
|
||||
CHECKSUM TABLE t;
|
||||
DROP TEMPORARY TABLE t;
|
||||
|
|
@ -1760,6 +1760,11 @@ ATTRIBUTE_COLD buf_pool_t::shrink_status buf_pool_t::shrink(size_t size)
|
|||
buf_flush_relocate_on_flush_list(b, &block->page);
|
||||
mysql_mutex_unlock(&flush_list_mutex);
|
||||
}
|
||||
else
|
||||
{
|
||||
ut_d(if (auto om= b->oldest_modification()) ut_ad(om == 2));
|
||||
b->oldest_modification_.store(0, std::memory_order_relaxed);
|
||||
}
|
||||
}
|
||||
|
||||
/* relocate LRU list */
|
||||
|
|
@ -2091,10 +2096,11 @@ ATTRIBUTE_COLD void buf_pool_t::resize(size_t size, THD *thd) noexcept
|
|||
|
||||
while (buf_page_t *b= UT_LIST_GET_FIRST(withdrawn))
|
||||
{
|
||||
ut_ad(!b->oldest_modification());
|
||||
ut_ad(b->state() == buf_page_t::NOT_USED);
|
||||
UT_LIST_REMOVE(withdrawn, b);
|
||||
UT_LIST_ADD_LAST(free, b);
|
||||
ut_d(b->in_free_list= true);
|
||||
ut_ad(b->state() == buf_page_t::NOT_USED);
|
||||
b->lock.init();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue