Skip to content

Commit 24062fe

Browse files
committed
Remove the debug variables innodb_purge_stop_now, innodb_purge_run_now
The InnoDB purge subsystem can be best stopped by opening a read view, for example by START TRANSACTION WITH CONSISTENT SNAPSHOT. To ensure that everything is purged, use wait_all_purged.inc, which waits for the History list length in SHOW ENGINE INNODB STATUS to reach 0. Setting innodb_purge_run_now never guaranteed this.
1 parent d06e4fc commit 24062fe

10 files changed

+28
-256
lines changed

mysql-test/suite/innodb/r/innodb-wl5522-debug.result

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ c4 VARCHAR(2048),
494494
INDEX idx1(c2),
495495
INDEX idx2(c3(512)),
496496
INDEX idx3(c4(512))) Engine=InnoDB;
497-
SET GLOBAL INNODB_PURGE_STOP_NOW=ON;
497+
connect purge_control,localhost,root;
498+
START TRANSACTION WITH CONSISTENT SNAPSHOT;
499+
connection default;
498500
SET GLOBAL innodb_disable_background_merge=ON;
499501
SET GLOBAL innodb_monitor_reset = ibuf_merges;
500502
SET GLOBAL innodb_monitor_reset = ibuf_merges_insert;
@@ -659,7 +661,10 @@ FROM information_schema.innodb_metrics
659661
WHERE name = 'ibuf_merges_inserts' AND count > 0;
660662
name
661663
SET GLOBAL innodb_disable_background_merge=OFF;
662-
SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
664+
connection purge_control;
665+
COMMIT;
666+
disconnect purge_control;
667+
connection default;
663668
DROP TABLE test_wl5522.t1;
664669
CREATE TABLE test_wl5522.t1 (
665670
c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,

mysql-test/suite/innodb/t/innodb-wl5522-debug.test

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,9 @@ CREATE TABLE test_wl5522.t1 (
10551055
INDEX idx3(c4(512))) Engine=InnoDB;
10561056

10571057
# Stop purge so that it doesn't remove the delete marked entries.
1058-
SET GLOBAL INNODB_PURGE_STOP_NOW=ON;
1058+
connect (purge_control,localhost,root);
1059+
START TRANSACTION WITH CONSISTENT SNAPSHOT;
1060+
connection default;
10591061

10601062
# Disable change buffer merge from the master thread, additionally
10611063
# enable aggressive flushing so that more changes are buffered.
@@ -1125,7 +1127,10 @@ SELECT name
11251127
SET GLOBAL innodb_disable_background_merge=OFF;
11261128

11271129
# Enable normal operation
1128-
SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
1130+
connection purge_control;
1131+
COMMIT;
1132+
disconnect purge_control;
1133+
connection default;
11291134

11301135
DROP TABLE test_wl5522.t1;
11311136

mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ INDEX idx1(c2),
123123
INDEX idx2(c3(512)),
124124
INDEX idx3(c4(512))) Engine=InnoDB
125125
ROW_FORMAT=COMPRESSED;
126-
SET GLOBAL INNODB_PURGE_STOP_NOW=ON;
126+
connect purge_control,localhost,root;
127+
START TRANSACTION WITH CONSISTENT SNAPSHOT;
128+
connection default;
127129
SET GLOBAL innodb_disable_background_merge=ON;
128130
SET GLOBAL innodb_monitor_reset = ibuf_merges;
129131
SET GLOBAL innodb_monitor_reset = ibuf_merges_insert;
@@ -288,7 +290,10 @@ FROM information_schema.innodb_metrics
288290
WHERE name = 'ibuf_merges_inserts' AND count > 0;
289291
name
290292
SET GLOBAL innodb_disable_background_merge=OFF;
291-
SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
293+
connection purge_control;
294+
COMMIT;
295+
disconnect purge_control;
296+
connection default;
292297
DROP TABLE test_wl5522.t1;
293298
CREATE TABLE test_wl5522.t1 (
294299
c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,

mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ CREATE TABLE test_wl5522.t1 (
321321
ROW_FORMAT=COMPRESSED;
322322

323323
# Stop purge so that it doesn't remove the delete marked entries.
324-
SET GLOBAL INNODB_PURGE_STOP_NOW=ON;
324+
connect (purge_control,localhost,root);
325+
START TRANSACTION WITH CONSISTENT SNAPSHOT;
326+
connection default;
325327

326328
# Disable change buffer merge from the master thread, additionally
327329
# enable aggressive flushing so that more changes are buffered.
@@ -391,7 +393,10 @@ SELECT name
391393
SET GLOBAL innodb_disable_background_merge=OFF;
392394

393395
# Enable normal operation
394-
SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
396+
connection purge_control;
397+
COMMIT;
398+
disconnect purge_control;
399+
connection default;
395400

396401
DROP TABLE test_wl5522.t1;
397402

mysql-test/suite/sys_vars/r/innodb_purge_run_now_basic.result

Lines changed: 0 additions & 27 deletions
This file was deleted.

mysql-test/suite/sys_vars/r/innodb_purge_stop_now_basic.result

Lines changed: 0 additions & 27 deletions
This file was deleted.

mysql-test/suite/sys_vars/r/sysvars_innodb.result

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,34 +2274,6 @@ NUMERIC_BLOCK_SIZE 0
22742274
ENUM_VALUE_LIST NULL
22752275
READ_ONLY NO
22762276
COMMAND_LINE_ARGUMENT OPTIONAL
2277-
VARIABLE_NAME INNODB_PURGE_RUN_NOW
2278-
SESSION_VALUE NULL
2279-
GLOBAL_VALUE OFF
2280-
GLOBAL_VALUE_ORIGIN COMPILE-TIME
2281-
DEFAULT_VALUE OFF
2282-
VARIABLE_SCOPE GLOBAL
2283-
VARIABLE_TYPE BOOLEAN
2284-
VARIABLE_COMMENT Set purge state to RUN
2285-
NUMERIC_MIN_VALUE NULL
2286-
NUMERIC_MAX_VALUE NULL
2287-
NUMERIC_BLOCK_SIZE NULL
2288-
ENUM_VALUE_LIST OFF,ON
2289-
READ_ONLY NO
2290-
COMMAND_LINE_ARGUMENT OPTIONAL
2291-
VARIABLE_NAME INNODB_PURGE_STOP_NOW
2292-
SESSION_VALUE NULL
2293-
GLOBAL_VALUE OFF
2294-
GLOBAL_VALUE_ORIGIN COMPILE-TIME
2295-
DEFAULT_VALUE OFF
2296-
VARIABLE_SCOPE GLOBAL
2297-
VARIABLE_TYPE BOOLEAN
2298-
VARIABLE_COMMENT Set purge state to STOP
2299-
NUMERIC_MIN_VALUE NULL
2300-
NUMERIC_MAX_VALUE NULL
2301-
NUMERIC_BLOCK_SIZE NULL
2302-
ENUM_VALUE_LIST OFF,ON
2303-
READ_ONLY NO
2304-
COMMAND_LINE_ARGUMENT OPTIONAL
23052277
VARIABLE_NAME INNODB_PURGE_THREADS
23062278
SESSION_VALUE NULL
23072279
GLOBAL_VALUE 4

mysql-test/suite/sys_vars/t/innodb_purge_run_now_basic.test

Lines changed: 0 additions & 53 deletions
This file was deleted.

mysql-test/suite/sys_vars/t/innodb_purge_stop_now_basic.test

Lines changed: 0 additions & 53 deletions
This file was deleted.

storage/innobase/handler/ha_innodb.cc

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -19750,8 +19750,6 @@ innobase_fts_find_ranking(FT_INFO* fts_hdl, uchar*, uint)
1975019750

1975119751
#ifdef UNIV_DEBUG
1975219752
static my_bool innodb_background_drop_list_empty = TRUE;
19753-
static my_bool innodb_purge_run_now = TRUE;
19754-
static my_bool innodb_purge_stop_now = TRUE;
1975519753
static my_bool innodb_log_checkpoint_now = TRUE;
1975619754
static my_bool innodb_buf_flush_list_now = TRUE;
1975719755
static uint innodb_merge_threshold_set_all_debug
@@ -19775,52 +19773,6 @@ wait_background_drop_list_empty(
1977519773
row_wait_for_background_drop_list_empty();
1977619774
}
1977719775

19778-
/****************************************************************//**
19779-
Set the purge state to RUN. If purge is disabled then it
19780-
is a no-op. This function is registered as a callback with MySQL. */
19781-
static
19782-
void
19783-
purge_run_now_set(
19784-
/*==============*/
19785-
THD* thd /*!< in: thread handle */
19786-
MY_ATTRIBUTE((unused)),
19787-
struct st_mysql_sys_var* var /*!< in: pointer to system
19788-
variable */
19789-
MY_ATTRIBUTE((unused)),
19790-
void* var_ptr /*!< out: where the formal
19791-
string goes */
19792-
MY_ATTRIBUTE((unused)),
19793-
const void* save) /*!< in: immediate result from
19794-
check function */
19795-
{
19796-
if (*(my_bool*) save && trx_purge_state() != PURGE_STATE_DISABLED) {
19797-
trx_purge_run();
19798-
}
19799-
}
19800-
19801-
/****************************************************************//**
19802-
Set the purge state to STOP. If purge is disabled then it
19803-
is a no-op. This function is registered as a callback with MySQL. */
19804-
static
19805-
void
19806-
purge_stop_now_set(
19807-
/*===============*/
19808-
THD* thd /*!< in: thread handle */
19809-
MY_ATTRIBUTE((unused)),
19810-
struct st_mysql_sys_var* var /*!< in: pointer to system
19811-
variable */
19812-
MY_ATTRIBUTE((unused)),
19813-
void* var_ptr /*!< out: where the formal
19814-
string goes */
19815-
MY_ATTRIBUTE((unused)),
19816-
const void* save) /*!< in: immediate result from
19817-
check function */
19818-
{
19819-
if (*(my_bool*) save && trx_purge_state() != PURGE_STATE_DISABLED) {
19820-
trx_purge_stop();
19821-
}
19822-
}
19823-
1982419776
/****************************************************************//**
1982519777
Force innodb to checkpoint. */
1982619778
static
@@ -20629,16 +20581,6 @@ static MYSQL_SYSVAR_BOOL(background_drop_list_empty,
2062920581
"Wait for the background drop list to become empty",
2063020582
NULL, wait_background_drop_list_empty, FALSE);
2063120583

20632-
static MYSQL_SYSVAR_BOOL(purge_run_now, innodb_purge_run_now,
20633-
PLUGIN_VAR_OPCMDARG,
20634-
"Set purge state to RUN",
20635-
NULL, purge_run_now_set, FALSE);
20636-
20637-
static MYSQL_SYSVAR_BOOL(purge_stop_now, innodb_purge_stop_now,
20638-
PLUGIN_VAR_OPCMDARG,
20639-
"Set purge state to STOP",
20640-
NULL, purge_stop_now_set, FALSE);
20641-
2064220584
static MYSQL_SYSVAR_BOOL(log_checkpoint_now, innodb_log_checkpoint_now,
2064320585
PLUGIN_VAR_OPCMDARG,
2064420586
"Force checkpoint now",
@@ -21912,8 +21854,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
2191221854
MYSQL_SYSVAR(purge_batch_size),
2191321855
#ifdef UNIV_DEBUG
2191421856
MYSQL_SYSVAR(background_drop_list_empty),
21915-
MYSQL_SYSVAR(purge_run_now),
21916-
MYSQL_SYSVAR(purge_stop_now),
2191721857
MYSQL_SYSVAR(log_checkpoint_now),
2191821858
MYSQL_SYSVAR(buf_flush_list_now),
2191921859
MYSQL_SYSVAR(merge_threshold_set_all_debug),

0 commit comments

Comments
 (0)