mirror of
https://github.com/MariaDB/server.git
synced 2025-07-20 10:18:13 +02:00

Added option 'aria-pagecache-segments', default 1. For values > 1, this split the aria-pagecache-buffer into the given number of segments, each independent from each other. Having multiple pagecaches improve performance when multiple connections runs queries concurrently using different tables. Each pagecache will use aria-pageache-buffer/segments amount of memory, however at least 128K. Each opened table has its index and data file use the segments in a a round-robin fashion. Internal changes: - All programs allocating the maria pagecache themselves should now call multi_init_pagecache() instead of init_pagecache(). - pagecache statistics is now stored in 'pagecache_stats' instead of maria_pagecache. One must call multi_update_pagecache_stats() to update the statistics. - Added into PAGECACHE_FILE a pointer to files pagecache. This was done to ensure that index and data file are using the same pagecache and simplified the checkpoint code. I kept pagecache in TABLE_SHARE to minimize the changes. - really_execute_checkpoint() was update to handle a dynamic number of pagecaches. - pagecache_collect_changed_blocks_with_lsn() was slight changed to allow it to be called for each pagecache. - undefined not used functions maria_assign_pagecache() and maria_change_pagecache() - ma_pagecaches.c is totally rewritten. It now contains all multi_pagecache functions. Errors found be QA that are fixed: MDEV-36872 UBSAN errors in ma_checkpoint.c MDEV-36874 Behavior upon too small aria_pagecache_buffer_size in case of multiple segments is not very user-friendly MDEV-36914 ma_checkpoint.c(285,9): conversion from '__int64' to 'uint' treated as an error MDEV-36912 sys_vars.sysvars_server_embedded and sys_vars.sysvars_server_notembedded fail on x86
63 lines
1.8 KiB
Text
63 lines
1.8 KiB
Text
drop database if exists mysqltest;
|
|
create database mysqltest;
|
|
connect admin, localhost, root,,mysqltest,,;
|
|
connection default;
|
|
use mysqltest;
|
|
connection default;
|
|
connection admin;
|
|
* shut down mysqld, removed logs, restarted it
|
|
connection default;
|
|
create table t1 (a varchar(10000)) engine=aria;
|
|
* TEST of over-allocated bitmap not flushed by checkpoint
|
|
insert into t1 values ("bbbbbbb");
|
|
connection admin;
|
|
flush table t1;
|
|
* copied t1 for comparison
|
|
connection default;
|
|
insert into t1 values ("bbbbbbb");
|
|
delete from t1 limit 1;
|
|
connect extra, localhost, root,,mysqltest,,;
|
|
set session debug_dbug="+d,info,enter,exit,maria_over_alloc_bitmap";
|
|
insert into t1 values ("aaaaaaaaa");
|
|
connection admin;
|
|
set global aria_checkpoint_interval=1;
|
|
connection admin;
|
|
SET SESSION debug_dbug="+d,maria_crash";
|
|
* crashing mysqld intentionally
|
|
set global aria_checkpoint_interval=1;
|
|
ERROR HY000: Lost connection to server during query
|
|
* recovery happens
|
|
check table t1 extended;
|
|
Table Op Msg_type Msg_text
|
|
mysqltest.t1 check status OK
|
|
* testing that checksum after recovery is as expected
|
|
Checksum-check
|
|
ok
|
|
connection default;
|
|
use mysqltest;
|
|
connection default;
|
|
* TEST of bitmap flushed without REDO-UNDO in the log (WAL violation)
|
|
connection admin;
|
|
flush table t1;
|
|
* copied t1 for comparison
|
|
connection default;
|
|
lock tables t1 write;
|
|
insert into t1 values (REPEAT('a', 6000));
|
|
connection admin;
|
|
SET SESSION debug_dbug="+d,maria_flush_bitmap,maria_crash";
|
|
* crashing mysqld intentionally
|
|
set global aria_checkpoint_interval=1;
|
|
ERROR HY000: Lost connection to server during query
|
|
* recovery happens
|
|
check table t1 extended;
|
|
Table Op Msg_type Msg_text
|
|
mysqltest.t1 check status OK
|
|
* testing that checksum after recovery is as expected
|
|
Checksum-check
|
|
ok
|
|
connection default;
|
|
use mysqltest;
|
|
drop table t1;
|
|
flush global status;
|
|
drop database mysqltest_for_comparison;
|
|
drop database mysqltest;
|