From bd47d6f36099c3a6b01eca229e0a5c3bf793adca Mon Sep 17 00:00:00 2001 From: "vtkachenko@intelp4d.mysql.com" <> Date: Wed, 5 Jan 2005 12:43:48 +0100 Subject: [PATCH 1/4] set_var.cc, mysqld.cc, ha_innodb.h, innodb.test, innodb.result: Create new innodb_sync_spin_loops variable --- mysql-test/r/innodb.result | 15 +++++++++++++++ mysql-test/t/innodb.test | 9 +++++++++ sql/ha_innodb.h | 1 + sql/mysqld.cc | 6 ++++++ sql/set_var.cc | 4 ++++ 5 files changed, 35 insertions(+) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 06940d65a79..cdb2c1d6aae 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1715,5 +1715,20 @@ Innodb_row_lock_time_max 0 show status like "Innodb_row_lock_time_avg"; Variable_name Value Innodb_row_lock_time_avg 0 +show variables like "innodb_sync_spin_loops"; +Variable_name Value +innodb_sync_spin_loops 20 +set global innodb_sync_spin_loops=1000; +show variables like "innodb_sync_spin_loops"; +Variable_name Value +innodb_sync_spin_loops 1000 +set global innodb_sync_spin_loops=0; +show variables like "innodb_sync_spin_loops"; +Variable_name Value +innodb_sync_spin_loops 0 +set global innodb_sync_spin_loops=20; +show variables like "innodb_sync_spin_loops"; +Variable_name Value +innodb_sync_spin_loops 20 create table t1 (v varchar(16384)) engine=innodb; ERROR 42000: Column length too big for column 'v' (max = 255); use BLOB instead diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index cee216e9e29..0ffd9e4e9f5 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1218,6 +1218,15 @@ show status like "Innodb_row_lock_time"; show status like "Innodb_row_lock_time_max"; show status like "Innodb_row_lock_time_avg"; +# Test for innodb_sync_spin_loops variable +show variables like "innodb_sync_spin_loops"; +set global innodb_sync_spin_loops=1000; +show variables like "innodb_sync_spin_loops"; +set global innodb_sync_spin_loops=0; +show variables like "innodb_sync_spin_loops"; +set global innodb_sync_spin_loops=20; +show variables like "innodb_sync_spin_loops"; + # # Test varchar # diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index fcb9165de64..e7277ea03a3 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -212,6 +212,7 @@ extern "C" { extern ulong srv_max_buf_pool_modified_pct; extern ulong srv_max_purge_lag; extern ulong srv_auto_extend_increment; +extern ulong srv_n_spin_wait_rounds; extern ulong srv_max_purge_lag; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e9d4a088d16..e88f4eb0e73 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4199,6 +4199,7 @@ enum options_mysqld OPT_INNODB_TABLE_LOCKS, OPT_INNODB_OPEN_FILES, OPT_INNODB_AUTOEXTEND_INCREMENT, + OPT_INNODB_SYNC_SPIN_LOOPS, OPT_BDB_CACHE_SIZE, OPT_BDB_LOG_BUFFER_SIZE, OPT_BDB_MAX_LOCK, @@ -5044,6 +5045,11 @@ log and this option does nothing anymore.", "How many files at the maximum InnoDB keeps open at the same time.", (gptr*) &innobase_open_files, (gptr*) &innobase_open_files, 0, GET_LONG, REQUIRED_ARG, 300L, 10L, ~0L, 0, 1L, 0}, + {"innodb_sync_spin_loops", OPT_INNODB_SYNC_SPIN_LOOPS, + "Count of spin-loop rounds in InnoDB mutexes", + (gptr*) &srv_n_spin_wait_rounds, + (gptr*) &srv_n_spin_wait_rounds, + 0, GET_LONG, REQUIRED_ARG, 20L, 0L, ~0L, 0, 1L, 0}, #ifdef HAVE_REPLICATION /* Disabled for the 4.1.3 release. Disabling just this paragraph of code is diff --git a/sql/set_var.cc b/sql/set_var.cc index d710be2bb2e..3597a4930f8 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -378,6 +378,8 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", &SV::innodb_table_locks); sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", &srv_auto_extend_increment); +sys_var_long_ptr sys_innodb_sync_spin_loops("innodb_sync_spin_loops", + &srv_n_spin_wait_rounds); #endif #ifdef HAVE_NDBCLUSTER_DB @@ -651,6 +653,7 @@ sys_var *sys_variables[]= &sys_innodb_table_locks, &sys_innodb_max_purge_lag, &sys_innodb_autoextend_increment, + &sys_innodb_sync_spin_loops, #endif #ifdef HAVE_NDBCLUSTER_DB &sys_ndb_autoincrement_prefetch_sz, @@ -763,6 +766,7 @@ struct show_var_st init_vars[]= { {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG }, {"innodb_thread_concurrency", (char*) &innobase_thread_concurrency, SHOW_LONG }, + {sys_innodb_sync_spin_loops.name, (char*) &sys_innodb_sync_spin_loops, SHOW_SYS}, #endif {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS}, {sys_join_buffer_size.name, (char*) &sys_join_buffer_size, SHOW_SYS}, From ad7dad8d038463a4546f3a33a9619c776a790940 Mon Sep 17 00:00:00 2001 From: "vtkachenko@intelp4d.mysql.com" <> Date: Sat, 8 Jan 2005 15:01:37 +0100 Subject: [PATCH 2/4] Many files: - Create innodb_thread_concurrency as dynamic variable - Add innodb_thread_sleep_delay variable - Add innodb_free_tickets_to_enter variable --- innobase/include/srv0srv.h | 2 ++ innobase/srv/srv0srv.c | 16 +++++++++----- mysql-test/r/innodb.result | 45 ++++++++++++++++++++++++++++++++++++++ mysql-test/t/innodb.test | 27 +++++++++++++++++++++++ sql/ha_innodb.cc | 3 +-- sql/ha_innodb.h | 3 +++ sql/mysqld.cc | 16 +++++++++++++- sql/set_var.cc | 13 ++++++++++- 8 files changed, 115 insertions(+), 10 deletions(-) diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index 5f752717fcc..c5374fd00fa 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -134,6 +134,8 @@ extern ibool srv_lock_timeout_and_monitor_active; extern ibool srv_error_monitor_active; extern ulint srv_n_spin_wait_rounds; +extern ulint srv_n_free_tickets_to_enter; +extern ulint srv_thread_sleep_delay; extern ulint srv_spin_wait_delay; extern ibool srv_priority_boost; diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 61bddc9da2c..49403f93f64 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -297,8 +297,8 @@ srv_conc_slot_t* srv_conc_slots; /* array of wait /* Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket at srv_conc_enter_innodb */ -#define SRV_FREE_TICKETS_TO_ENTER 500 - +#define SRV_FREE_TICKETS_TO_ENTER srv_n_free_tickets_to_enter +#define SRV_THREAD_SLEEP_DELAY srv_thread_sleep_delay /*-----------------------*/ /* If the following is set TRUE then we do not run purge and insert buffer merge to completion before shutdown */ @@ -328,6 +328,8 @@ ulint srv_max_purge_lag = 0; /*-------------------------------------------*/ ulint srv_n_spin_wait_rounds = 20; +ulint srv_n_free_tickets_to_enter = 500; +ulint srv_thread_sleep_delay = 10000; ulint srv_spin_wait_delay = 5; ibool srv_priority_boost = TRUE; @@ -1025,8 +1027,8 @@ retry: return; } - /* If the transaction is not holding resources, let it sleep for 50 - milliseconds, and try again then */ + /* If the transaction is not holding resources, + let it sleep for SRV_THREAD_SLEEP_DELAY microseconds, and try again then */ if (!has_slept && !trx->has_search_latch && NULL == UT_LIST_GET_FIRST(trx->trx_locks)) { @@ -1045,8 +1047,10 @@ retry: situations of lots of thread switches. Simply put some threads aside for a while to reduce the number of thread switches. */ - - os_thread_sleep(10000); + if (SRV_THREAD_SLEEP_DELAY > 0) + { + os_thread_sleep(SRV_THREAD_SLEEP_DELAY); + } trx->op_info = ""; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index cdb2c1d6aae..148296de256 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1730,5 +1730,50 @@ set global innodb_sync_spin_loops=20; show variables like "innodb_sync_spin_loops"; Variable_name Value innodb_sync_spin_loops 20 +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 8 +set global innodb_thread_concurrency=1000; +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 1000 +set global innodb_thread_concurrency=0; +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 1 +set global innodb_thread_concurrency=16; +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 16 +show variables like "innodb_free_tickets_to_enter"; +Variable_name Value +innodb_free_tickets_to_enter 500 +set global innodb_free_tickets_to_enter=1000; +show variables like "innodb_free_tickets_to_enter"; +Variable_name Value +innodb_free_tickets_to_enter 1000 +set global innodb_free_tickets_to_enter=0; +show variables like "innodb_free_tickets_to_enter"; +Variable_name Value +innodb_free_tickets_to_enter 1 +set global innodb_free_tickets_to_enter=500; +show variables like "innodb_free_tickets_to_enter"; +Variable_name Value +innodb_free_tickets_to_enter 500 +show variables like "innodb_thread_sleep_delay"; +Variable_name Value +innodb_thread_sleep_delay 10000 +set global innodb_thread_sleep_delay=100000; +show variables like "innodb_thread_sleep_delay"; +Variable_name Value +innodb_thread_sleep_delay 100000 +set global innodb_thread_sleep_delay=0; +show variables like "innodb_thread_sleep_delay"; +Variable_name Value +innodb_thread_sleep_delay 0 +set global innodb_thread_sleep_delay=10000; +show variables like "innodb_thread_sleep_delay"; +Variable_name Value +innodb_thread_sleep_delay 10000 create table t1 (v varchar(16384)) engine=innodb; ERROR 42000: Column length too big for column 'v' (max = 255); use BLOB instead diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 0ffd9e4e9f5..3870bb01f0a 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1227,6 +1227,33 @@ show variables like "innodb_sync_spin_loops"; set global innodb_sync_spin_loops=20; show variables like "innodb_sync_spin_loops"; +# Test for innodb_thread_concurrency variable +show variables like "innodb_thread_concurrency"; +set global innodb_thread_concurrency=1000; +show variables like "innodb_thread_concurrency"; +set global innodb_thread_concurrency=0; +show variables like "innodb_thread_concurrency"; +set global innodb_thread_concurrency=16; +show variables like "innodb_thread_concurrency"; + +# Test for innodb_free_tickets_to_enter variable +show variables like "innodb_free_tickets_to_enter"; +set global innodb_free_tickets_to_enter=1000; +show variables like "innodb_free_tickets_to_enter"; +set global innodb_free_tickets_to_enter=0; +show variables like "innodb_free_tickets_to_enter"; +set global innodb_free_tickets_to_enter=500; +show variables like "innodb_free_tickets_to_enter"; + +# Test for innodb_thread_sleep_delay variable +show variables like "innodb_thread_sleep_delay"; +set global innodb_thread_sleep_delay=100000; +show variables like "innodb_thread_sleep_delay"; +set global innodb_thread_sleep_delay=0; +show variables like "innodb_thread_sleep_delay"; +set global innodb_thread_sleep_delay=10000; +show variables like "innodb_thread_sleep_delay"; + # # Test varchar # diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 91517770d04..afaac8ba83b 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -250,7 +250,7 @@ struct show_var_st innodb_status_variables[]= { {"rows_updated", (char*) &export_vars.innodb_rows_updated, SHOW_LONG}, {NullS, NullS, SHOW_LONG}}; - + /* General functions */ /********************************************************************** @@ -1132,7 +1132,6 @@ innobase_init(void) srv_n_file_io_threads = (ulint) innobase_file_io_threads; srv_lock_wait_timeout = (ulint) innobase_lock_wait_timeout; - srv_thread_concurrency = (ulint) innobase_thread_concurrency; srv_force_recovery = (ulint) innobase_force_recovery; srv_fast_shutdown = (ibool) innobase_fast_shutdown; diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index e7277ea03a3..0cb55e02ae3 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -213,7 +213,10 @@ extern ulong srv_max_buf_pool_modified_pct; extern ulong srv_max_purge_lag; extern ulong srv_auto_extend_increment; extern ulong srv_n_spin_wait_rounds; +extern ulong srv_n_free_tickets_to_enter; +extern ulong srv_thread_sleep_delay; extern ulong srv_max_purge_lag; +extern ulong srv_thread_concurrency; } extern TYPELIB innobase_lock_typelib; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e88f4eb0e73..82efc51234a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4200,6 +4200,8 @@ enum options_mysqld OPT_INNODB_OPEN_FILES, OPT_INNODB_AUTOEXTEND_INCREMENT, OPT_INNODB_SYNC_SPIN_LOOPS, + OPT_INNODB_FREE_TICKETS_TO_ENTER, + OPT_INNODB_THREAD_SLEEP_DELAY, OPT_BDB_CACHE_SIZE, OPT_BDB_LOG_BUFFER_SIZE, OPT_BDB_MAX_LOCK, @@ -5050,6 +5052,12 @@ log and this option does nothing anymore.", (gptr*) &srv_n_spin_wait_rounds, (gptr*) &srv_n_spin_wait_rounds, 0, GET_LONG, REQUIRED_ARG, 20L, 0L, ~0L, 0, 1L, 0}, + {"innodb_free_tickets_to_enter", OPT_INNODB_FREE_TICKETS_TO_ENTER, + "Number of times a thread is allowed to enter InnoDB within the same \ + SQL query after it has once got the ticket", + (gptr*) &srv_n_free_tickets_to_enter, + (gptr*) &srv_n_free_tickets_to_enter, + 0, GET_LONG, REQUIRED_ARG, 500L, 1L, ~0L, 0, 1L, 0}, #ifdef HAVE_REPLICATION /* Disabled for the 4.1.3 release. Disabling just this paragraph of code is @@ -5072,8 +5080,14 @@ log and this option does nothing anymore.", #endif {"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY, "Helps in performance tuning in heavily concurrent environments.", - (gptr*) &innobase_thread_concurrency, (gptr*) &innobase_thread_concurrency, + (gptr*) &srv_thread_concurrency, (gptr*) &srv_thread_concurrency, 0, GET_LONG, REQUIRED_ARG, 8, 1, 1000, 0, 1, 0}, + {"innodb_thread_sleep_delay", OPT_INNODB_THREAD_SLEEP_DELAY, + "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0" + " disable a sleep", + (gptr*) &srv_thread_sleep_delay, + (gptr*) &srv_thread_sleep_delay, + 0, GET_LONG, REQUIRED_ARG, 10000L, 0L, ~0L, 0, 1L, 0}, #endif /* HAVE_INNOBASE_DB */ {"interactive_timeout", OPT_INTERACTIVE_TIMEOUT, "The number of seconds the server waits for activity on an interactive connection before closing it.", diff --git a/sql/set_var.cc b/sql/set_var.cc index 3597a4930f8..da41522e3fe 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -380,6 +380,12 @@ sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", &srv_auto_extend_increment); sys_var_long_ptr sys_innodb_sync_spin_loops("innodb_sync_spin_loops", &srv_n_spin_wait_rounds); +sys_var_long_ptr sys_innodb_free_tickets_to_enter("innodb_free_tickets_to_enter", + &srv_n_free_tickets_to_enter); +sys_var_long_ptr sys_innodb_thread_sleep_delay("innodb_thread_sleep_delay", + &srv_thread_sleep_delay); +sys_var_long_ptr sys_innodb_thread_concurrency("innodb_thread_concurrency", + &srv_thread_concurrency); #endif #ifdef HAVE_NDBCLUSTER_DB @@ -654,6 +660,9 @@ sys_var *sys_variables[]= &sys_innodb_max_purge_lag, &sys_innodb_autoextend_increment, &sys_innodb_sync_spin_loops, + &sys_innodb_free_tickets_to_enter, + &sys_innodb_thread_sleep_delay, + &sys_innodb_thread_concurrency, #endif #ifdef HAVE_NDBCLUSTER_DB &sys_ndb_autoincrement_prefetch_sz, @@ -752,6 +761,7 @@ struct show_var_st init_vars[]= { {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_INT}, {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR}, {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG }, + {sys_innodb_free_tickets_to_enter.name, (char*) &sys_innodb_free_tickets_to_enter, SHOW_SYS}, {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG }, {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR}, {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL}, @@ -765,7 +775,8 @@ struct show_var_st init_vars[]= { {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS}, {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG }, - {"innodb_thread_concurrency", (char*) &innobase_thread_concurrency, SHOW_LONG }, + {sys_innodb_thread_concurrency.name, (char*) &sys_innodb_thread_concurrency, SHOW_SYS}, + {sys_innodb_thread_sleep_delay.name, (char*) &sys_innodb_thread_sleep_delay, SHOW_SYS}, {sys_innodb_sync_spin_loops.name, (char*) &sys_innodb_sync_spin_loops, SHOW_SYS}, #endif {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS}, From 3f8d6698739ca69c33724d71255f888a28dc89e0 Mon Sep 17 00:00:00 2001 From: "tulin@build.mysql.com" <> Date: Wed, 12 Jan 2005 18:19:30 +0100 Subject: [PATCH 3/4] fix shm key --- ndb/src/mgmsrv/ConfigInfo.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 800ffe2e361..fa77bc14762 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -98,6 +98,7 @@ static bool fixDepricated(InitConfigFileParser::Context & ctx, const char *); static bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char *); static bool fixFileSystemPath(InitConfigFileParser::Context & ctx, const char * data); static bool fixBackupDataDir(InitConfigFileParser::Context & ctx, const char * data); +static bool fixShmUniqueId(InitConfigFileParser::Context & ctx, const char * data); const ConfigInfo::SectionRule ConfigInfo::m_SectionRules[] = { @@ -111,6 +112,8 @@ ConfigInfo::m_SectionRules[] = { { "REP", transformNode, 0 }, { "EXTERNAL REP", transformExtNode, 0 }, + { MGM_TOKEN, fixShmUniqueId, 0 }, + { "TCP", checkConnectionSupport, 0 }, { "SHM", checkConnectionSupport, 0 }, { "SCI", checkConnectionSupport, 0 }, @@ -3155,19 +3158,39 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ DBUG_RETURN(true); } +static bool +fixShmUniqueId(InitConfigFileParser::Context & ctx, const char * data) +{ + DBUG_ENTER("fixShmUniqueId"); + Uint32 nodes= 0; + ctx.m_userProperties.get(ctx.fname, &nodes); + if (nodes == 1) // first management server + { + Uint32 portno= atoi(NDB_PORT); + ctx.m_currentSection->get("PortNumber", &portno); + ctx.m_userProperties.put("ShmUniqueId", portno); + } + DBUG_RETURN(true); +} + static bool fixShmKey(InitConfigFileParser::Context & ctx, const char *) { + DBUG_ENTER("fixShmKey"); Uint32 id1= 0, id2= 0, key= 0; require(ctx.m_currentSection->get("NodeId1", &id1)); require(ctx.m_currentSection->get("NodeId2", &id2)); if(ctx.m_currentSection->get("ShmKey", &key)) - return true; + { + DBUG_RETURN(true); + } - key= (id1 > id2 ? id1 << 16 | id2 : id2 << 16 | id1); + require(ctx.m_userProperties.get("ShmUniqueId", &key)); + key= key << 16 | (id1 > id2 ? id1 << 8 | id2 : id2 << 8 | id1); ctx.m_currentSection->put("ShmKey", key); - return true; + DBUG_PRINT("info",("Added ShmKey=0x%x", key)); + DBUG_RETURN(true); } /** From 9f640bbad9d4bab1124019e17d1596e647f6ac76 Mon Sep 17 00:00:00 2001 From: "vtkachenko@mail.mysql.com" <> Date: Wed, 12 Jan 2005 20:55:06 +0100 Subject: [PATCH 4/4] logging_ok: Logging to logging@openlogging.org accepted innodb.result, innodb.test, set_var.cc, mysqld.cc: change variable innodb_free_tickets_to_enter to innodb_concurrency_tickets --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/innodb.result | 22 +++++++++++----------- mysql-test/t/innodb.test | 16 ++++++++-------- sql/mysqld.cc | 4 ++-- sql/set_var.cc | 6 +++--- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 0f4bc8d7b37..02e65271dbe 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -244,6 +244,7 @@ venu@hundin.mysql.fi venu@myvenu.com venu@work.mysql.com vtkachenko@intelp4d.mysql.com +vtkachenko@mail.mysql.com vva@eagle.mysql.r18.ru vva@genie.(none) vva@mysql.r18.ru diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 148296de256..bdd5ac0bd63 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1745,21 +1745,21 @@ set global innodb_thread_concurrency=16; show variables like "innodb_thread_concurrency"; Variable_name Value innodb_thread_concurrency 16 -show variables like "innodb_free_tickets_to_enter"; +show variables like "innodb_concurrency_tickets"; Variable_name Value -innodb_free_tickets_to_enter 500 -set global innodb_free_tickets_to_enter=1000; -show variables like "innodb_free_tickets_to_enter"; +innodb_concurrency_tickets 500 +set global innodb_concurrency_tickets=1000; +show variables like "innodb_concurrency_tickets"; Variable_name Value -innodb_free_tickets_to_enter 1000 -set global innodb_free_tickets_to_enter=0; -show variables like "innodb_free_tickets_to_enter"; +innodb_concurrency_tickets 1000 +set global innodb_concurrency_tickets=0; +show variables like "innodb_concurrency_tickets"; Variable_name Value -innodb_free_tickets_to_enter 1 -set global innodb_free_tickets_to_enter=500; -show variables like "innodb_free_tickets_to_enter"; +innodb_concurrency_tickets 1 +set global innodb_concurrency_tickets=500; +show variables like "innodb_concurrency_tickets"; Variable_name Value -innodb_free_tickets_to_enter 500 +innodb_concurrency_tickets 500 show variables like "innodb_thread_sleep_delay"; Variable_name Value innodb_thread_sleep_delay 10000 diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 3870bb01f0a..4fff24a61d5 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1236,14 +1236,14 @@ show variables like "innodb_thread_concurrency"; set global innodb_thread_concurrency=16; show variables like "innodb_thread_concurrency"; -# Test for innodb_free_tickets_to_enter variable -show variables like "innodb_free_tickets_to_enter"; -set global innodb_free_tickets_to_enter=1000; -show variables like "innodb_free_tickets_to_enter"; -set global innodb_free_tickets_to_enter=0; -show variables like "innodb_free_tickets_to_enter"; -set global innodb_free_tickets_to_enter=500; -show variables like "innodb_free_tickets_to_enter"; +# Test for innodb_concurrency_tickets variable +show variables like "innodb_concurrency_tickets"; +set global innodb_concurrency_tickets=1000; +show variables like "innodb_concurrency_tickets"; +set global innodb_concurrency_tickets=0; +show variables like "innodb_concurrency_tickets"; +set global innodb_concurrency_tickets=500; +show variables like "innodb_concurrency_tickets"; # Test for innodb_thread_sleep_delay variable show variables like "innodb_thread_sleep_delay"; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 278b07413ba..d831913b822 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4202,7 +4202,7 @@ enum options_mysqld OPT_INNODB_OPEN_FILES, OPT_INNODB_AUTOEXTEND_INCREMENT, OPT_INNODB_SYNC_SPIN_LOOPS, - OPT_INNODB_FREE_TICKETS_TO_ENTER, + OPT_INNODB_CONCURRENCY_TICKETS, OPT_INNODB_THREAD_SLEEP_DELAY, OPT_BDB_CACHE_SIZE, OPT_BDB_LOG_BUFFER_SIZE, @@ -5054,7 +5054,7 @@ log and this option does nothing anymore.", (gptr*) &srv_n_spin_wait_rounds, (gptr*) &srv_n_spin_wait_rounds, 0, GET_LONG, REQUIRED_ARG, 20L, 0L, ~0L, 0, 1L, 0}, - {"innodb_free_tickets_to_enter", OPT_INNODB_FREE_TICKETS_TO_ENTER, + {"innodb_concurrency_tickets", OPT_INNODB_CONCURRENCY_TICKETS, "Number of times a thread is allowed to enter InnoDB within the same \ SQL query after it has once got the ticket", (gptr*) &srv_n_free_tickets_to_enter, diff --git a/sql/set_var.cc b/sql/set_var.cc index da41522e3fe..23a880bc7ed 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -380,7 +380,7 @@ sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", &srv_auto_extend_increment); sys_var_long_ptr sys_innodb_sync_spin_loops("innodb_sync_spin_loops", &srv_n_spin_wait_rounds); -sys_var_long_ptr sys_innodb_free_tickets_to_enter("innodb_free_tickets_to_enter", +sys_var_long_ptr sys_innodb_concurrency_tickets("innodb_concurrency_tickets", &srv_n_free_tickets_to_enter); sys_var_long_ptr sys_innodb_thread_sleep_delay("innodb_thread_sleep_delay", &srv_thread_sleep_delay); @@ -660,7 +660,7 @@ sys_var *sys_variables[]= &sys_innodb_max_purge_lag, &sys_innodb_autoextend_increment, &sys_innodb_sync_spin_loops, - &sys_innodb_free_tickets_to_enter, + &sys_innodb_concurrency_tickets, &sys_innodb_thread_sleep_delay, &sys_innodb_thread_concurrency, #endif @@ -754,6 +754,7 @@ struct show_var_st init_vars[]= { {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR}, {"innodb_doublewrite", (char*) &innobase_use_doublewrite, SHOW_MY_BOOL}, {"innodb_checksums", (char*) &innobase_use_checksums, SHOW_MY_BOOL}, + {sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS}, {"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL}, {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG }, {"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL}, @@ -761,7 +762,6 @@ struct show_var_st init_vars[]= { {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_INT}, {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR}, {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG }, - {sys_innodb_free_tickets_to_enter.name, (char*) &sys_innodb_free_tickets_to_enter, SHOW_SYS}, {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG }, {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR}, {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL},