From 078a52381bf9c0cf7e22e25477c94dee713fcf21 Mon Sep 17 00:00:00 2001 From: Fariha Shaikh Date: Mon, 2 Mar 2026 19:13:29 +0000 Subject: [PATCH] MDEV-38936 Proactive handling of InnoDB tablespace full condition InnoDB write failures occur when tablespace files exceed filesystem size limits. Current behavior logs errors but continues accepting transactions, causing repeated failures and potential data integrity issues. Add proactive monitoring by emitting warnings when InnoDB tablespaces approach a configurable size threshold. Key features: - Two new system variables: * innodb_tablespace_size_warning_threshold (default 0, disabled): Maximum tablespace size in bytes before warnings begin * innodb_tablespace_size_warning_pct (default 85%): Percentage of threshold at which to start emitting warnings - Warning frequency: * Below warning_pct: No warnings * At or above warning_pct: Every 1% increase (85%, 86%, 87%, etc.) - Per-tablespace tracking with automatic reset on TRUNCATE/DROP or threshold/percentage changes - Zero overhead when threshold is 0 - Progressive warnings capped at 100% Implementation adds fil_space_t::extend() which consolidates file extension, size_in_header update, and size warning checks. Per-tablespace warning state is tracked in fil_space_t (m_last_size_warning_pct, m_last_warning_threshold, m_last_warning_pct). All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- .../innodb/r/tablespace_size_warning.result | 74 ++++++++++ .../innodb/t/tablespace_size_warning.test | 134 ++++++++++++++++++ .../suite/sys_vars/r/sysvars_innodb.result | 24 ++++ storage/innobase/fsp/fsp0fsp.cc | 117 ++++++++++----- storage/innobase/handler/ha_innodb.cc | 20 +++ storage/innobase/include/fil0fil.h | 32 +++++ 6 files changed, 368 insertions(+), 33 deletions(-) create mode 100644 mysql-test/suite/innodb/r/tablespace_size_warning.result create mode 100644 mysql-test/suite/innodb/t/tablespace_size_warning.test diff --git a/mysql-test/suite/innodb/r/tablespace_size_warning.result b/mysql-test/suite/innodb/r/tablespace_size_warning.result new file mode 100644 index 0000000000000..d64f20a4a494c --- /dev/null +++ b/mysql-test/suite/innodb/r/tablespace_size_warning.result @@ -0,0 +1,74 @@ +# +# MDEV-38936: Proactive handling of InnoDB tablespace full condition +# +# Test basic warning emission +SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; +SET GLOBAL innodb_tablespace_size_warning_pct = 70; +CREATE TABLE t1 ( +id INT AUTO_INCREMENT PRIMARY KEY, +data LONGBLOB +) ENGINE=InnoDB; +INSERT INTO t1 (data) SELECT REPEAT('a', 1024*1024) FROM seq_1_to_10; +FOUND 1 /Tablespace 'test/t1' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes/ in mysqld.1.err +FOUND 1 /Tablespace 'test/t1' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes/ in mysqld.1.err +FOUND 1 /Tablespace 'test/t1' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes/ in mysqld.1.err +FOUND 1 /Tablespace 'test/t1' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes/ in mysqld.1.err +DROP TABLE t1; +# Test configurable warning percentage +SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; +SET GLOBAL innodb_tablespace_size_warning_pct = 80; +CREATE TABLE t1b ( +id INT AUTO_INCREMENT PRIMARY KEY, +data LONGBLOB +) ENGINE=InnoDB; +INSERT INTO t1b (data) SELECT REPEAT('x', 1024*1024) FROM seq_1_to_8; +FOUND 1 /Tablespace 'test/t1b' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes/ in mysqld.1.err +FOUND 1 /Tablespace 'test/t1b' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes/ in mysqld.1.err +DROP TABLE t1b; +# Test threshold set to zero disables warnings +SET GLOBAL innodb_tablespace_size_warning_threshold = 0; +CREATE TABLE t2 ( +id INT AUTO_INCREMENT PRIMARY KEY, +data LONGBLOB +) ENGINE=InnoDB; +INSERT INTO t2 (data) SELECT REPEAT('b', 1024*1024) FROM seq_1_to_5; +NOT FOUND /Tablespace 'test/t2' size \d+ bytes reached \d+% of configured threshold/ in mysqld.1.err +DROP TABLE t2; +# Test disable via threshold=0 then re-enable +SET GLOBAL innodb_tablespace_size_warning_threshold = 0; +SET GLOBAL innodb_tablespace_size_warning_pct = 70; +CREATE TABLE t3 ( +id INT AUTO_INCREMENT PRIMARY KEY, +data LONGBLOB +) ENGINE=InnoDB; +INSERT INTO t3 (data) SELECT REPEAT('c', 1024*1024) FROM seq_1_to_10; +SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; +INSERT INTO t3 (data) VALUES (REPEAT('d', 1024*1024)); +FOUND 1 /Tablespace 'test/t3' size 12582912 bytes reached 100% of configured threshold of 10485760 bytes/ in mysqld.1.err +DROP TABLE t3; +# Test TRUNCATE TABLE resets warning state +CREATE TABLE t4 ( +id INT AUTO_INCREMENT PRIMARY KEY, +data LONGBLOB +) ENGINE=InnoDB; +INSERT INTO t4 (data) SELECT REPEAT('e', 1024*1024) FROM seq_1_to_10; +FOUND 1 /Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes/ in mysqld.1.err +FOUND 1 /Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes/ in mysqld.1.err +TRUNCATE TABLE t4; +INSERT INTO t4 (data) SELECT REPEAT('f', 1024*1024) FROM seq_1_to_10; +FOUND 2 /Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes/ in mysqld.1.err +FOUND 2 /Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes/ in mysqld.1.err +DROP TABLE t4; +# Test behavior when tablespace exceeds 100% of threshold +SET GLOBAL innodb_tablespace_size_warning_threshold = 5242880; +SET GLOBAL innodb_tablespace_size_warning_pct = 70; +CREATE TABLE t5 ( +id INT AUTO_INCREMENT PRIMARY KEY, +data LONGBLOB +) ENGINE=InnoDB; +INSERT INTO t5 (data) SELECT REPEAT('g', 1024*1024) FROM seq_1_to_10; +FOUND 1 /Tablespace 'test/t5' size 4194304 bytes reached 80% of configured threshold of 5242880 bytes/ in mysqld.1.err +FOUND 1 /Tablespace 'test/t5' size 5242880 bytes reached 100% of configured threshold of 5242880 bytes/ in mysqld.1.err +DROP TABLE t5; +SET GLOBAL innodb_tablespace_size_warning_threshold = 0; +SET GLOBAL innodb_tablespace_size_warning_pct = 85; diff --git a/mysql-test/suite/innodb/t/tablespace_size_warning.test b/mysql-test/suite/innodb/t/tablespace_size_warning.test new file mode 100644 index 0000000000000..af36954473e1d --- /dev/null +++ b/mysql-test/suite/innodb/t/tablespace_size_warning.test @@ -0,0 +1,134 @@ +--source include/have_innodb.inc +--source include/have_innodb_16k.inc +--source include/have_sequence.inc +--source include/not_embedded.inc + +--disable_query_log +call mtr.add_suppression("InnoDB: Tablespace .* size .* bytes reached .* of configured threshold"); +--enable_query_log + +--echo # +--echo # MDEV-38936: Proactive handling of InnoDB tablespace full condition +--echo # + +--echo # Test basic warning emission +SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; +SET GLOBAL innodb_tablespace_size_warning_pct = 70; + +CREATE TABLE t1 ( + id INT AUTO_INCREMENT PRIMARY KEY, + data LONGBLOB +) ENGINE=InnoDB; + +INSERT INTO t1 (data) SELECT REPEAT('a', 1024*1024) FROM seq_1_to_10; + +let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err; +let SEARCH_PATTERN=Tablespace 'test/t1' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc +let SEARCH_PATTERN=Tablespace 'test/t1' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc +let SEARCH_PATTERN=Tablespace 'test/t1' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc +let SEARCH_PATTERN=Tablespace 'test/t1' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc + +DROP TABLE t1; + +--echo # Test configurable warning percentage +SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; +SET GLOBAL innodb_tablespace_size_warning_pct = 80; + +CREATE TABLE t1b ( + id INT AUTO_INCREMENT PRIMARY KEY, + data LONGBLOB +) ENGINE=InnoDB; + +INSERT INTO t1b (data) SELECT REPEAT('x', 1024*1024) FROM seq_1_to_8; + +let SEARCH_PATTERN=Tablespace 'test/t1b' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc +let SEARCH_PATTERN=Tablespace 'test/t1b' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc + +DROP TABLE t1b; + +--echo # Test threshold set to zero disables warnings +SET GLOBAL innodb_tablespace_size_warning_threshold = 0; + +CREATE TABLE t2 ( + id INT AUTO_INCREMENT PRIMARY KEY, + data LONGBLOB +) ENGINE=InnoDB; + +INSERT INTO t2 (data) SELECT REPEAT('b', 1024*1024) FROM seq_1_to_5; + +let SEARCH_PATTERN=Tablespace 'test/t2' size \d+ bytes reached \d+% of configured threshold; +--source include/search_pattern_in_file.inc + +DROP TABLE t2; + +--echo # Test disable via threshold=0 then re-enable +SET GLOBAL innodb_tablespace_size_warning_threshold = 0; +SET GLOBAL innodb_tablespace_size_warning_pct = 70; + +CREATE TABLE t3 ( + id INT AUTO_INCREMENT PRIMARY KEY, + data LONGBLOB +) ENGINE=InnoDB; + +INSERT INTO t3 (data) SELECT REPEAT('c', 1024*1024) FROM seq_1_to_10; + +SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760; + +INSERT INTO t3 (data) VALUES (REPEAT('d', 1024*1024)); + +let SEARCH_PATTERN=Tablespace 'test/t3' size 12582912 bytes reached 100% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc + +DROP TABLE t3; + +--echo # Test TRUNCATE TABLE resets warning state +CREATE TABLE t4 ( + id INT AUTO_INCREMENT PRIMARY KEY, + data LONGBLOB +) ENGINE=InnoDB; + +INSERT INTO t4 (data) SELECT REPEAT('e', 1024*1024) FROM seq_1_to_10; + +let SEARCH_PATTERN=Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc +let SEARCH_PATTERN=Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc + +TRUNCATE TABLE t4; + +INSERT INTO t4 (data) SELECT REPEAT('f', 1024*1024) FROM seq_1_to_10; + +let SEARCH_PATTERN=Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc +let SEARCH_PATTERN=Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes; +--source include/search_pattern_in_file.inc + +DROP TABLE t4; + +--echo # Test behavior when tablespace exceeds 100% of threshold +SET GLOBAL innodb_tablespace_size_warning_threshold = 5242880; +SET GLOBAL innodb_tablespace_size_warning_pct = 70; + +CREATE TABLE t5 ( + id INT AUTO_INCREMENT PRIMARY KEY, + data LONGBLOB +) ENGINE=InnoDB; + +INSERT INTO t5 (data) SELECT REPEAT('g', 1024*1024) FROM seq_1_to_10; + +let SEARCH_PATTERN=Tablespace 'test/t5' size 4194304 bytes reached 80% of configured threshold of 5242880 bytes; +--source include/search_pattern_in_file.inc +let SEARCH_PATTERN=Tablespace 'test/t5' size 5242880 bytes reached 100% of configured threshold of 5242880 bytes; +--source include/search_pattern_in_file.inc + +DROP TABLE t5; + +# Restore default values +SET GLOBAL innodb_tablespace_size_warning_threshold = 0; +SET GLOBAL innodb_tablespace_size_warning_pct = 85; diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index dd604089003c3..08d15a76fd7c6 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1654,6 +1654,30 @@ NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME INNODB_TABLESPACE_SIZE_WARNING_PCT +SESSION_VALUE NULL +DEFAULT_VALUE 85 +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE INT UNSIGNED +VARIABLE_COMMENT Percentage at which to start emitting tablespace size warnings +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 100 +NUMERIC_BLOCK_SIZE 0 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME INNODB_TABLESPACE_SIZE_WARNING_THRESHOLD +SESSION_VALUE NULL +DEFAULT_VALUE 0 +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_COMMENT Threshold in bytes for tablespace size warnings (0 = disabled) +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_BLOCK_SIZE 0 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME INNODB_TABLE_LOCKS SESSION_VALUE ON DEFAULT_VALUE ON diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc index 859399fd77dee..bb426dc349b3c 100644 --- a/storage/innobase/fsp/fsp0fsp.cc +++ b/storage/innobase/fsp/fsp0fsp.cc @@ -596,29 +596,15 @@ fsp_try_extend_data_file_with_pages( buf_block_t* header, mtr_t* mtr) { - bool success; - ulint size; - ut_ad(!is_system_tablespace(space->id)); ut_d(space->modify_check(*mtr)); - size = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SIZE - + header->page.frame); + uint32_t size = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SIZE + + header->page.frame); ut_ad(size == space->size_in_header); - ut_a(page_no >= size); - success = fil_space_extend(space, page_no + 1); - /* The size may be less than we wanted if we ran out of disk space. */ - /* recv_sys_t::parse() expects to find a WRITE record that - covers all 4 bytes. Therefore, we must specify mtr_t::FORCED - in order to avoid optimizing away any unchanged most - significant bytes of FSP_SIZE. */ - mtr->write<4,mtr_t::FORCED>(*header, FSP_HEADER_OFFSET + FSP_SIZE - + header->page.frame, space->size); - space->size_in_header = space->size; - - return(success); + return space->extend(page_no + 1, header, mtr); } /** Calculate the number of physical pages in an extent for this file. @@ -660,6 +646,86 @@ static uint32_t fsp_get_pages_to_extend_ibd(unsigned physical_size, return extent_size; } +/** Check if tablespace size exceeds warning threshold and emit warning. +@param new_size New size in pages +@param threshold nonzero warning threshold in bytes +@return true if warning was emitted */ +ATTRIBUTE_COLD bool fil_space_t::check_size_warning(uint32_t new_size, + ulonglong threshold) + noexcept +{ + const uint warning_pct= fil_system.tablespace_size_warning_pct; + + /* Reset state if threshold or warning percentage changed */ + const uint32_t threshold_pages= + uint32_t(threshold / physical_size()); + if ((m_last_warning_threshold ^ threshold_pages) | + (uint{m_last_warning_pct} ^ warning_pct)) { + m_last_size_warning_pct= 0; + m_last_warning_threshold= threshold_pages; + m_last_warning_pct= uint8_t(warning_pct); + } + + uint64_t current_bytes= + uint64_t(new_size) * physical_size(); + /* new_size is at most 1ULL<<32 and physical_size() at most 1<<16, + so current_bytes * 100 < 1ULL<<55, well within uint64_t range. */ + uint64_t current_pct= + (current_bytes * 100) / threshold; + uint8_t display_pct= + uint8_t(std::min(current_pct, uint64_t{100})); + + if (display_pct < warning_pct) + return false; + + if (display_pct <= m_last_size_warning_pct) + return false; + + /* Warn on every 1% increase */ + const auto n= name(); + sql_print_warning("InnoDB: Tablespace '%.*s' size %llu bytes" + " reached %u%% of configured threshold" + " of %llu bytes", + int(n.size()), n.data(), + ulonglong{current_bytes}, + unsigned{display_pct}, + ulonglong{threshold}); + + m_last_size_warning_pct= display_pct; + + return true; +} + +/** Extend the tablespace, update size_in_header, and emit size warnings. +@param size desired size in pages +@param header tablespace header block +@param mtr mini-transaction +@return whether the extension succeeded */ +bool fil_space_t::extend(uint32_t size, buf_block_t *header, mtr_t *mtr) + noexcept +{ + if (!fil_space_extend(this, size)) + return false; + + /* For the system tablespace, we ignore any fragments of a + full megabyte when storing the size to the space header */ + const unsigned ps= physical_size(); + size_in_header= id + ? this->size + : ut_2pow_round(this->size, (1024 * 1024) / ps); + + /* recv_sys_t::parse() expects to find a WRITE record that + covers all 4 bytes. Therefore, we must specify mtr_t::FORCED + in order to avoid optimizing away any unchanged most + significant bytes of FSP_SIZE. */ + mtr->write<4,mtr_t::FORCED>(*header, FSP_HEADER_OFFSET + FSP_SIZE + + header->page.frame, size_in_header); + + if (uint64_t threshold= fil_system.tablespace_size_warning_threshold) + check_size_warning(size_in_header, threshold); + return true; +} + /** Try to extend the last data file of a tablespace if it is auto-extending. @param[in,out] space tablespace @param[in,out] header tablespace header @@ -741,25 +807,10 @@ fsp_try_extend_data_file(fil_space_t *space, buf_block_t *header, mtr_t *mtr) return(0); } - if (!fil_space_extend(space, size + size_increase)) { + if (!space->extend(size + size_increase, header, mtr)) { return(0); } - /* For the system tablespace, we ignore any fragments of a - full megabyte when storing the size to the space header */ - - space->size_in_header = space->id - ? space->size - : ut_2pow_round(space->size, (1024 * 1024) / ps); - - /* recv_sys_t::parse() expects to find a WRITE record that - covers all 4 bytes. Therefore, we must specify mtr_t::FORCED - in order to avoid optimizing away any unchanged most - significant bytes of FSP_SIZE. */ - mtr->write<4,mtr_t::FORCED>(*header, FSP_HEADER_OFFSET + FSP_SIZE - + header->page.frame, - space->size_in_header); - return(size_increase); } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 5e6f8e44e7e29..acb31ec47bed6 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -19396,6 +19396,24 @@ static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size, 1, /* Minimum value */ innodb_purge_batch_size_MAX, 0); +static MYSQL_SYSVAR_ULONGLONG(tablespace_size_warning_threshold, + fil_system.tablespace_size_warning_threshold, + PLUGIN_VAR_RQCMDARG, + "Threshold in bytes for tablespace size warnings (0 = disabled)", + NULL, NULL, + 0, /* Default setting */ + 0, /* Minimum value */ + ULLONG_MAX, 0); /* Maximum value */ + +static MYSQL_SYSVAR_UINT(tablespace_size_warning_pct, + fil_system.tablespace_size_warning_pct, + PLUGIN_VAR_RQCMDARG, + "Percentage at which to start emitting tablespace size warnings", + NULL, NULL, + 85, /* Default setting */ + 0, /* Minimum value */ + 100, 0); /* Maximum value */ + extern void srv_update_purge_thread_count(uint n); static @@ -20445,6 +20463,8 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(monitor_reset_all), MYSQL_SYSVAR(purge_threads), MYSQL_SYSVAR(purge_batch_size), + MYSQL_SYSVAR(tablespace_size_warning_threshold), + MYSQL_SYSVAR(tablespace_size_warning_pct), MYSQL_SYSVAR(log_checkpoint_now), #ifdef UNIV_DEBUG MYSQL_SYSVAR(buf_flush_list_now), diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index a43020daf7b63..96e8bc1a31927 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -80,6 +80,7 @@ inline bool srv_is_undo_tablespace(uint32_t space_id) } class page_id_t; +struct buf_block_t; /** Structure containing encryption specification */ struct fil_space_crypt_t; @@ -420,6 +421,32 @@ struct fil_space_t final /** LSN of undo tablespace creation or 0; protected by latch */ lsn_t create_lsn= 0; + +public: + /** Check if tablespace size exceeds warning threshold and emit warning. + @param new_size New size in pages + @param threshold nonzero warning threshold in bytes + @return true if warning was emitted */ + ATTRIBUTE_COLD bool check_size_warning(uint32_t new_size, + ulonglong threshold) noexcept; + + /** Extend the tablespace, update size_in_header, and emit size warnings. + @param size desired size in pages + @param header tablespace header block + @param mtr mini-transaction + @return whether the extension succeeded */ + bool extend(uint32_t size, buf_block_t *header, mtr_t *mtr) noexcept; + +private: + /** Threshold in pages used for the last warning */ + uint32_t m_last_warning_threshold{0}; + + /** Last percentage at which we emitted a size warning (0-100) */ + uint8_t m_last_size_warning_pct{0}; + + /** Warning pct value used for the last warning */ + uint8_t m_last_warning_pct{0}; + public: /** @return whether this is the temporary tablespace */ bool is_temporary() const noexcept @@ -1496,6 +1523,11 @@ struct fil_system_t potential space_id reuse */ bool space_id_reuse_warned; + /** Percentage at which to start emitting tablespace size warnings */ + uint32_t tablespace_size_warning_pct; + /** Threshold in bytes for tablespace size warnings (0 = disabled) */ + ulonglong tablespace_size_warning_threshold; + /** Add the file to the end of opened spaces list in fil_system.space_list, so that fil_space_t::try_to_close() should close it as a last resort.