Commit 0eabc285 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.3 into 10.4 (MDEV-27913)

parents 46764652 7ab3db14
call mtr.add_suppression("InnoDB: Total InnoDB FTS size .* for the table .* exceeds the innodb_ft_cache_size .*");
#
# Bug#32831765 SERVER HITS OOM CONDITION WHEN LOADING TWO
# INNODB TABLES WITH FTS INDEXES
......
......@@ -2,6 +2,7 @@
--source include/have_debug.inc
--source include/big_test.inc
call mtr.add_suppression("InnoDB: Total InnoDB FTS size .* for the table .* exceeds the innodb_ft_cache_size .*");
--echo #
--echo # Bug#32831765 SERVER HITS OOM CONDITION WHEN LOADING TWO
--echo # INNODB TABLES WITH FTS INDEXES
......
......@@ -16,6 +16,15 @@ select * from information_schema.session_variables where variable_name='innodb_f
VARIABLE_NAME VARIABLE_VALUE
INNODB_FT_CACHE_SIZE 8000000
set global innodb_ft_cache_size=1;
ERROR HY000: Variable 'innodb_ft_cache_size' is a read only variable
Warnings:
Warning 1292 Truncated incorrect innodb_ft_cache_size value: '1'
SHOW VARIABLES like 'innodb_ft_cache_size';
Variable_name Value
innodb_ft_cache_size 1600000
set session innodb_ft_cache_size=1;
ERROR HY000: Variable 'innodb_ft_cache_size' is a read only variable
ERROR HY000: Variable 'innodb_ft_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_ft_cache_size=512*1024*1024;
SHOW VARIABLES like 'innodb_ft_cache_size';
Variable_name Value
innodb_ft_cache_size 536870912
set global innodb_ft_cache_size=default;
......@@ -16,6 +16,15 @@ select * from information_schema.session_variables where variable_name='innodb_f
VARIABLE_NAME VARIABLE_VALUE
INNODB_FT_TOTAL_CACHE_SIZE 640000000
set global innodb_ft_total_cache_size=1;
ERROR HY000: Variable 'innodb_ft_total_cache_size' is a read only variable
Warnings:
Warning 1292 Truncated incorrect innodb_ft_total_cache_size value: '1'
set session innodb_ft_total_cache_size=1;
ERROR HY000: Variable 'innodb_ft_total_cache_size' is a read only variable
ERROR HY000: Variable 'innodb_ft_total_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
SHOW VARIABLES like 'innodb_ft_total_cache_size';
Variable_name Value
innodb_ft_total_cache_size 32000000
set global innodb_ft_total_cache_size=512*1024*1024;
show variables like 'innodb_ft_total_cache_size';
Variable_name Value
innodb_ft_total_cache_size 536870912
set global innodb_ft_total_cache_size=default;
......@@ -114,7 +114,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -697,7 +697,7 @@
@@ -709,7 +709,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 120
VARIABLE_SCOPE GLOBAL
......@@ -123,7 +123,7 @@
VARIABLE_COMMENT Number of pages reserved in doublewrite buffer for batch flushing
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 127
@@ -793,7 +793,7 @@
@@ -805,7 +805,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 600
VARIABLE_SCOPE GLOBAL
......@@ -132,7 +132,7 @@
VARIABLE_COMMENT Maximum number of seconds that semaphore times out in InnoDB.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -841,7 +841,7 @@
@@ -853,7 +853,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
......@@ -141,7 +141,7 @@
VARIABLE_COMMENT Make the first page of the given tablespace dirty.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -853,7 +853,7 @@
@@ -865,7 +865,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 30
VARIABLE_SCOPE GLOBAL
......@@ -150,7 +150,7 @@
VARIABLE_COMMENT Number of iterations over which the background flushing is averaged.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1000
@@ -877,7 +877,7 @@
@@ -889,7 +889,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
......@@ -159,7 +159,7 @@
VARIABLE_COMMENT Controls the durability/speed trade-off for commits. Set to 0 (write and flush redo log to disk only once per second), 1 (flush to disk at each commit), 2 (write to log at commit but flush to disk only once per second) or 3 (flush to disk at prepare and at commit, slower and usually redundant). 1 and 3 guarantees that after a crash, committed transactions will not be lost and will be consistent with the binlog and other transactional engines. 2 can get inconsistent and lose transactions if there is a power failure or kernel crash but not if mysqld crashes. 0 has no guarantees in case of crash. 0 and 2 can be faster than 1 or 3.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 3
@@ -901,7 +901,7 @@
@@ -913,7 +913,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
......@@ -168,7 +168,7 @@
VARIABLE_COMMENT Set to 0 (don't flush neighbors from buffer pool), 1 (flush contiguous neighbors from buffer pool) or 2 (flush neighbors from buffer pool), when flushing a block
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
@@ -949,7 +949,7 @@
@@ -961,7 +961,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
......@@ -177,7 +177,7 @@
VARIABLE_COMMENT Helps to save your data in case the disk image of the database becomes corrupt.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 6
@@ -973,7 +973,7 @@
@@ -985,10 +985,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 8000000
VARIABLE_SCOPE GLOBAL
......@@ -185,8 +185,12 @@
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT InnoDB Fulltext search cache size in bytes
NUMERIC_MIN_VALUE 1600000
NUMERIC_MAX_VALUE 80000000
@@ -1009,7 +1009,7 @@
-NUMERIC_MAX_VALUE 1099511627776
+NUMERIC_MAX_VALUE 536870912
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1021,7 +1021,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 84
VARIABLE_SCOPE GLOBAL
......@@ -195,7 +199,7 @@
VARIABLE_COMMENT InnoDB Fulltext search maximum token size in characters
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 84
@@ -1021,7 +1021,7 @@
@@ -1033,7 +1033,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 3
VARIABLE_SCOPE GLOBAL
......@@ -204,7 +208,7 @@
VARIABLE_COMMENT InnoDB Fulltext search minimum token size in characters
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16
@@ -1033,7 +1033,7 @@
@@ -1045,7 +1045,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
......@@ -213,7 +217,7 @@
VARIABLE_COMMENT InnoDB Fulltext search number of words to optimize for each optimize table call
NUMERIC_MIN_VALUE 1000
NUMERIC_MAX_VALUE 10000
@@ -1045,10 +1045,10 @@
@@ -1057,10 +1057,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2000000000
VARIABLE_SCOPE GLOBAL
......@@ -226,7 +230,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1069,7 +1069,7 @@
@@ -1081,7 +1081,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2
VARIABLE_SCOPE GLOBAL
......@@ -235,7 +239,7 @@
VARIABLE_COMMENT InnoDB Fulltext search parallel sort degree, will round up to nearest power of 2 number
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 16
@@ -1081,7 +1081,7 @@
@@ -1093,10 +1093,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 640000000
VARIABLE_SCOPE GLOBAL
......@@ -243,8 +247,12 @@
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Total memory allocated for InnoDB Fulltext Search cache
NUMERIC_MIN_VALUE 32000000
NUMERIC_MAX_VALUE 1600000000
@@ -1105,7 +1105,7 @@
-NUMERIC_MAX_VALUE 1099511627776
+NUMERIC_MAX_VALUE 1600000000
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1117,7 +1117,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
......@@ -253,7 +261,7 @@
VARIABLE_COMMENT DEPRECATED. This setting has no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
@@ -1141,22 +1141,22 @@
@@ -1153,22 +1153,22 @@
SESSION_VALUE NULL
DEFAULT_VALUE 200
VARIABLE_SCOPE GLOBAL
......@@ -281,7 +289,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1213,7 +1213,7 @@
@@ -1225,7 +1225,7 @@
SESSION_VALUE 50
DEFAULT_VALUE 50
VARIABLE_SCOPE SESSION
......@@ -290,7 +298,7 @@
VARIABLE_COMMENT Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1073741824
@@ -1225,10 +1225,10 @@
@@ -1237,10 +1237,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 16777216
VARIABLE_SCOPE GLOBAL
......@@ -303,7 +311,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY YES
@@ -1273,7 +1273,7 @@
@@ -1285,7 +1285,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2
VARIABLE_SCOPE GLOBAL
......@@ -312,7 +320,7 @@
VARIABLE_COMMENT Number of log files in the log group. InnoDB writes to the files in a circular fashion.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
@@ -1321,7 +1321,7 @@
@@ -1333,7 +1333,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 8192
VARIABLE_SCOPE GLOBAL
......@@ -321,7 +329,7 @@
VARIABLE_COMMENT Redo log write ahead unit size to avoid read-on-write, it should match the OS cache block IO size
NUMERIC_MIN_VALUE 512
NUMERIC_MAX_VALUE 16384
@@ -1333,10 +1333,10 @@
@@ -1345,10 +1345,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1024
VARIABLE_SCOPE GLOBAL
......@@ -334,7 +342,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1381,10 +1381,10 @@
@@ -1393,10 +1393,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
......@@ -347,7 +355,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1393,7 +1393,7 @@
@@ -1405,7 +1405,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
......@@ -356,7 +364,7 @@
VARIABLE_COMMENT Maximum delay of user threads in micro-seconds
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 10000000
@@ -1525,10 +1525,10 @@
@@ -1537,10 +1537,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
......@@ -369,7 +377,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
@@ -1549,7 +1549,7 @@
@@ -1561,7 +1561,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
......@@ -378,7 +386,7 @@
VARIABLE_COMMENT Page cleaner threads can be from 1 to 64. Default is 4.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 64
@@ -1573,7 +1573,7 @@
@@ -1585,7 +1585,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 16
VARIABLE_SCOPE GLOBAL
......@@ -387,7 +395,7 @@
VARIABLE_COMMENT Number of rw_locks protecting buffer pool page_hash. Rounded up to the next power of 2
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
@@ -1585,7 +1585,7 @@
@@ -1597,7 +1597,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 16384
VARIABLE_SCOPE GLOBAL
......@@ -396,7 +404,7 @@
VARIABLE_COMMENT Page size to use for all InnoDB tablespaces.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 65536
@@ -1621,7 +1621,7 @@
@@ -1633,7 +1633,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 300
VARIABLE_SCOPE GLOBAL
......@@ -405,7 +413,7 @@
VARIABLE_COMMENT Number of UNDO log pages to purge in one batch from the history list.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 5000
@@ -1633,7 +1633,7 @@
@@ -1645,7 +1645,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
......@@ -414,7 +422,7 @@
VARIABLE_COMMENT Dictates rate at which UNDO records are purged. Value N means purge rollback segment(s) on every Nth iteration of purge invocation
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
@@ -1645,7 +1645,7 @@
@@ -1657,7 +1657,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
......@@ -423,7 +431,7 @@
VARIABLE_COMMENT Purge threads can be from 1 to 32. Default is 4.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 32
@@ -1669,7 +1669,7 @@
@@ -1681,7 +1681,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 56
VARIABLE_SCOPE GLOBAL
......@@ -432,7 +440,7 @@
VARIABLE_COMMENT Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
@@ -1681,7 +1681,7 @@
@@ -1693,7 +1693,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
......@@ -441,7 +449,7 @@
VARIABLE_COMMENT Number of background read I/O threads in InnoDB.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 64
@@ -1705,10 +1705,10 @@
@@ -1717,10 +1717,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
......@@ -454,7 +462,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1729,7 +1729,7 @@
@@ -1741,7 +1741,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
......@@ -463,7 +471,7 @@
VARIABLE_COMMENT Number of undo logs to use (deprecated).
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
@@ -1741,7 +1741,7 @@
@@ -1753,7 +1753,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
......
......@@ -988,10 +988,10 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT InnoDB Fulltext search cache size in bytes
NUMERIC_MIN_VALUE 1600000
NUMERIC_MAX_VALUE 80000000
NUMERIC_MAX_VALUE 1099511627776
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_FT_ENABLE_DIAG_PRINT
SESSION_VALUE NULL
......@@ -1096,10 +1096,10 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Total memory allocated for InnoDB Fulltext Search cache
NUMERIC_MIN_VALUE 32000000
NUMERIC_MAX_VALUE 1600000000
NUMERIC_MAX_VALUE 1099511627776
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_FT_USER_STOPWORD_TABLE
SESSION_VALUE
......
......@@ -18,11 +18,12 @@ select * from information_schema.global_variables where variable_name='innodb_ft
select * from information_schema.session_variables where variable_name='innodb_ft_cache_size';
--enable_warnings
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_ft_cache_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SHOW VARIABLES like 'innodb_ft_cache_size';
--error ER_GLOBAL_VARIABLE
set session innodb_ft_cache_size=1;
set global innodb_ft_cache_size=512*1024*1024;
SHOW VARIABLES like 'innodb_ft_cache_size';
set global innodb_ft_cache_size=default;
......@@ -18,11 +18,11 @@ select * from information_schema.global_variables where variable_name='innodb_ft
select * from information_schema.session_variables where variable_name='innodb_ft_total_cache_size';
--enable_warnings
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_ft_total_cache_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
--error ER_GLOBAL_VARIABLE
set session innodb_ft_total_cache_size=1;
SHOW VARIABLES like 'innodb_ft_total_cache_size';
set global innodb_ft_total_cache_size=512*1024*1024;
show variables like 'innodb_ft_total_cache_size';
set global innodb_ft_total_cache_size=default;
......@@ -53,14 +53,14 @@ by looking up the key word in the obsolete table names */
/** This is maximum FTS cache for each table and would be
a configurable variable */
ulong fts_max_cache_size;
Atomic_relaxed<size_t> fts_max_cache_size;
/** Whether the total memory used for FTS cache is exhausted, and we will
need a sync to free some memory */
bool fts_need_sync = false;
/** Variable specifying the total memory allocated for FTS cache */
ulong fts_max_total_cache_size;
Atomic_relaxed<size_t> fts_max_total_cache_size;
/** This is FTS result cache limit for each query and would be
a configurable variable */
......@@ -4258,7 +4258,7 @@ fts_sync(
ulint i;
dberr_t error = DB_SUCCESS;
fts_cache_t* cache = sync->table->fts->cache;
size_t fts_cache_size= 0;
rw_lock_x_lock(&cache->lock);
/* Check if cache is being synced.
......@@ -4283,11 +4283,17 @@ fts_sync(
fts_sync_begin(sync);
begin_sync:
if (cache->total_size > fts_max_cache_size) {
fts_cache_size= fts_max_cache_size;
if (cache->total_size > fts_cache_size) {
/* Avoid the case: sync never finish when
insert/update keeps comming. */
ut_ad(sync->unlock_cache);
sync->unlock_cache = false;
ib::warn() << "Total InnoDB FTS size "
<< cache->total_size << " for the table "
<< cache->sync->table->name
<< " exceeds the innodb_ft_cache_size "
<< fts_cache_size;
}
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
......@@ -4310,6 +4316,13 @@ fts_sync(
if (error != DB_SUCCESS) {
goto end_sync;
}
if (!sync->unlock_cache
&& cache->total_size < fts_max_cache_size) {
/* Reset the unlock cache if the value
is less than innodb_ft_cache_size */
sync->unlock_cache = true;
}
}
DBUG_EXECUTE_IF("fts_instrument_sync_interrupted",
......
......@@ -785,6 +785,18 @@ innodb_stopword_table_validate(
for update function */
struct st_mysql_value* value); /*!< in: incoming string */
static
void innodb_ft_cache_size_update(THD*, st_mysql_sys_var*, void*, const void* save)
{
fts_max_cache_size= *static_cast<const size_t*>(save);
}
static
void innodb_ft_total_cache_size_update(THD*, st_mysql_sys_var*, void*, const void* save)
{
fts_max_total_cache_size= *static_cast<const size_t*>(save);
}
static bool is_mysql_datadir_path(const char *path);
/** Validate passed-in "value" is a valid directory name.
......@@ -19466,15 +19478,35 @@ static MYSQL_SYSVAR_STR(ft_aux_table, innodb_ft_aux_table,
"FTS internal auxiliary table to be checked",
innodb_ft_aux_table_validate, NULL, NULL);
static MYSQL_SYSVAR_ULONG(ft_cache_size, fts_max_cache_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
#if UNIV_WORD_SIZE == 4
static MYSQL_SYSVAR_SIZE_T(ft_cache_size,
*reinterpret_cast<size_t*>(&fts_max_cache_size),
PLUGIN_VAR_RQCMDARG,
"InnoDB Fulltext search cache size in bytes",
NULL, NULL, 8000000, 1600000, 80000000, 0);
NULL, innodb_ft_cache_size_update, 8000000, 1600000, 1U << 29, 0);
static MYSQL_SYSVAR_ULONG(ft_total_cache_size, fts_max_total_cache_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
static MYSQL_SYSVAR_SIZE_T(ft_total_cache_size,
*reinterpret_cast<size_t*>(&fts_max_total_cache_size),
PLUGIN_VAR_RQCMDARG,
"Total memory allocated for InnoDB Fulltext Search cache",
NULL, NULL, 640000000, 32000000, 1600000000, 0);
NULL, innodb_ft_total_cache_size_update, 640000000, 32000000, 1600000000, 0);
#else
static MYSQL_SYSVAR_SIZE_T(ft_cache_size,
*reinterpret_cast<size_t*>(&fts_max_cache_size),
PLUGIN_VAR_RQCMDARG,
"InnoDB Fulltext search cache size in bytes",
NULL, innodb_ft_cache_size_update, 8000000, 1600000, 1ULL << 40, 0);
static MYSQL_SYSVAR_SIZE_T(ft_total_cache_size,
*reinterpret_cast<size_t*>(&fts_max_total_cache_size),
PLUGIN_VAR_RQCMDARG,
"Total memory allocated for InnoDB Fulltext Search cache",
NULL, innodb_ft_total_cache_size_update, 640000000, 32000000, 1ULL << 40, 0);
#endif
static MYSQL_SYSVAR_SIZE_T(ft_result_cache_limit, fts_result_cache_limit,
PLUGIN_VAR_RQCMDARG,
......
/*****************************************************************************
Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2021, MariaDB Corporation.
Copyright (c) 2016, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -352,10 +352,10 @@ struct fts_stopword_t;
extern const char* fts_default_stopword[];
/** Variable specifying the maximum FTS cache size for each table */
extern ulong fts_max_cache_size;
extern Atomic_relaxed<size_t> fts_max_cache_size;
/** Variable specifying the total memory allocated for FTS cache */
extern ulong fts_max_total_cache_size;
extern Atomic_relaxed<size_t> fts_max_total_cache_size;
/** Variable specifying the FTS result cache limit for each query */
extern size_t fts_result_cache_limit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment