From 43a6e81ccb5026c4d60e27b504fbdc77951e906d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 9 Sep 2019 18:18:52 +0300 Subject: [PATCH] MDEV-19514 preparation: Remove innodb_change_buffering_debug=2 The setting innodb_change_buffering_debug=2 was supposed to inject a crash during change buffer merge. There is no public test for that functionality, and even if there were, it would be better to use DEBUG_SYNC to halt the thread that does change buffer merge, force a redo log flush from another thread, and finally kill the server externally. --- .../innodb_change_buffering_debug_basic.result | 6 ++++++ .../suite/sys_vars/r/sysvars_innodb.result | 4 ++-- .../t/innodb_change_buffering_debug_basic.test | 5 ++--- storage/innobase/handler/ha_innodb.cc | 4 ++-- storage/innobase/ibuf/ibuf0ibuf.cc | 17 ----------------- 5 files changed, 12 insertions(+), 24 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result index fc0078581fb6d..2cb3fc76e3071 100644 --- a/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result @@ -55,6 +55,12 @@ Warnings: Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '-2' set global innodb_change_buffering_debug=1e1; ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug' +set global innodb_change_buffering_debug=2; +Warnings: +Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '2' +select @@global.innodb_change_buffering_debug; +@@global.innodb_change_buffering_debug +1 SET @@global.innodb_change_buffering_debug = @start_global_value; SELECT @@global.innodb_change_buffering_debug; @@global.innodb_change_buffering_debug diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index f424f5a6c0593..79d24242435bc 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -347,9 +347,9 @@ SESSION_VALUE NULL DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED -VARIABLE_COMMENT Debug flags for InnoDB change buffering (0=none, 2=crash at merge) +VARIABLE_COMMENT Debug flags for InnoDB change buffering (0=none, 1=try to buffer) NUMERIC_MIN_VALUE 0 -NUMERIC_MAX_VALUE 2 +NUMERIC_MAX_VALUE 1 NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY NO diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test index a6fc09f767e54..70f8bee152356 100644 --- a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test @@ -48,9 +48,8 @@ set global innodb_change_buffering_debug='foo'; set global innodb_change_buffering_debug=-2; --error ER_WRONG_TYPE_FOR_VAR set global innodb_change_buffering_debug=1e1; -# The value 2 is supposed to kill the server if there are unmerged changes. -# Do not try to set the value to 2 or anything that can be clamped to 2. -#set global innodb_change_buffering_debug=2; +set global innodb_change_buffering_debug=2; +select @@global.innodb_change_buffering_debug; # # Cleanup diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 7c9e414888670..347cf6f21b782 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -20616,8 +20616,8 @@ static MYSQL_SYSVAR_ENUM(stats_method, srv_innodb_stats_method, #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug, PLUGIN_VAR_RQCMDARG, - "Debug flags for InnoDB change buffering (0=none, 2=crash at merge)", - NULL, NULL, 0, 0, 2, 0); + "Debug flags for InnoDB change buffering (0=none, 1=try to buffer)", + NULL, NULL, 0, 0, 1, 0); static MYSQL_SYSVAR_BOOL(disable_background_merge, srv_ibuf_disable_background_merge, diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index 29a7e8908a372..5581d1d109374 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -4241,23 +4241,6 @@ ibuf_delete_rec( ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no); ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space); -#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG - if (ibuf_debug == 2) { - /* Inject a fault (crash). We do this before trying - optimistic delete, because a pessimistic delete in the - change buffer would require a larger test case. */ - - /* Flag the buffered record as processed, to avoid - an assertion failure after crash recovery. */ - btr_cur_set_deleted_flag_for_ibuf( - btr_pcur_get_rec(pcur), NULL, TRUE, mtr); - - ibuf_mtr_commit(mtr); - log_write_up_to(LSN_MAX, true); - DBUG_SUICIDE(); - } -#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ - success = btr_cur_optimistic_delete(btr_pcur_get_btr_cur(pcur), 0, mtr);