From 12648015b322e885923f87d919c07529423a0eca Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 9 Aug 2010 20:05:42 +0300 Subject: Added --sync-sys=0 option for mysqld to skip sync() calls for faster testing Fixed LP#613418 (M)aria recovery failure: ma_key_recover.c:981: _ma_apply_redo_index: Assertion `check_page_length == page_length' failed include/my_sys.h: Added my_disable_sync mysql-test/mysql-test-run.pl: Added --sync-sys=0 to run test suite faster mysys/my_static.c: Added my_disable_sync mysys/my_sync.c: Added my_disable_sync sql/mysqld.cc: Added -sync-sys=0 option for mysqld to skip sync() calls for faster testing storage/maria/ma_key_recover.c: More DBUG_ASSERT() Added logging of KEY_OP_DEBUG to make examening of logs easier Fixed testing of page length in recovery to ensure we don't overwrite checksum (previous tests was too relaxed) Fixed bug in recovery logging of split pages which caused failure during recovery: - Length was not adjusted properly for pages to be split - Added KEY_OP_MAX_PAGELENGTH to tell recovery that page is now full length - This fixed LP#613418 storage/maria/ma_key_recover.h: Changed prototype for ma_log_change() for KEY_OP_DEBUG storage/maria/ma_loghandler.h: Added new enums for better debugging of recovery logs storage/maria/ma_rt_index.c: Added debugging information to calls to ma_log_change() storage/maria/ma_write.c: Added debugging information to calls to ma_log_change() and ma_log_split() --- sql/mysqld.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index eb46ba14f19..4f8cfd70615 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -418,6 +418,7 @@ static bool volatile ready_to_exit; static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; static my_bool opt_short_log_format= 0; static my_bool opt_ignore_wrong_options= 0, opt_expect_abort= 0; +static my_bool opt_sync= 0; static uint kill_cached_threads, wake_thread; ulong thread_created; static ulong max_used_connections; @@ -5897,7 +5898,7 @@ enum options_mysqld OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_ALLOW_SUSPICIOUS_UDFS, OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE, OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE, - OPT_SYNC_FRM, OPT_SYNC_BINLOG, + OPT_SYNC_FRM, OPT_SYNC_BINLOG, OPT_SYNC, OPT_SYNC_REPLICATION, OPT_SYNC_REPLICATION_SLAVE_ID, OPT_SYNC_REPLICATION_TIMEOUT, @@ -7417,6 +7418,10 @@ thread is in the relay logs.", {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.", &opt_sync_frm, &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"sync-sys", OPT_SYNC, + "Enable/disable system sync calls. Should only be turned off when running " + "tests or debugging!!", + &opt_sync, &opt_sync, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"table_cache", OPT_TABLE_OPEN_CACHE, "Deprecated; use --table_open_cache instead.", &table_cache_size, &table_cache_size, 0, GET_ULONG, @@ -9158,6 +9163,7 @@ static int get_options(int *argc,char **argv) In most cases the global variables will not be used */ my_disable_locking= myisam_single_user= test(opt_external_locking == 0); + my_disable_sync= opt_sync == 0; my_default_record_cache_size=global_system_variables.read_buff_size; myisam_max_temp_length= (my_off_t) global_system_variables.myisam_max_sort_file_size; -- cgit v1.2.1