diff options
author | Rich Prohaska <prohaska@tokutek.com> | 2014-02-21 08:21:31 -0500 |
---|---|---|
committer | Rich Prohaska <prohaska@tokutek.com> | 2014-02-21 08:21:31 -0500 |
commit | 3fbd54a96d49dd2894841080b032bf6ac7899af7 (patch) | |
tree | 08ff5088768b296887c4234f362153d3e258c692 /storage | |
parent | f07613f140b6e8db4dc5c195a0033c0ba7b65888 (diff) | |
download | mariadb-git-3fbd54a96d49dd2894841080b032bf6ac7899af7.tar.gz |
#189 add tokudb_kill_time session variable to set lock tree kill callback frequency
Diffstat (limited to 'storage')
-rw-r--r-- | storage/tokudb/hatoku_hton.cc | 3 | ||||
-rw-r--r-- | storage/tokudb/hatoku_hton.h | 28 |
2 files changed, 20 insertions, 11 deletions
diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 8ab34f14a60..7310fa4c028 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -494,6 +494,8 @@ static int tokudb_init_func(void *p) { r = db_env->set_lock_timeout(db_env, DEFAULT_TOKUDB_LOCK_TIMEOUT, tokudb_get_lock_wait_time_callback); assert(r == 0); + db_env->set_killed_callback(db_env, DEFAULT_TOKUDB_KILLED_TIME, tokudb_get_killed_time_callback, tokudb_killed_callback); + r = db_env->get_engine_status_num_rows (db_env, &toku_global_status_max_rows); assert(r == 0); @@ -1283,6 +1285,7 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = { MYSQL_SYSVAR(lock_timeout_debug), MYSQL_SYSVAR(loader_memory_size), MYSQL_SYSVAR(hide_default_row_format), + MYSQL_SYSVAR(killed_time), NULL }; diff --git a/storage/tokudb/hatoku_hton.h b/storage/tokudb/hatoku_hton.h index 18c371f41b3..005eb626241 100644 --- a/storage/tokudb/hatoku_hton.h +++ b/storage/tokudb/hatoku_hton.h @@ -348,18 +348,9 @@ static MYSQL_THDVAR_STR(last_lock_timeout, PLUGIN_VAR_MEMALLOC, "last TokuDB loc static MYSQL_THDVAR_BOOL(hide_default_row_format, 0, "hide the default row format", NULL /*check*/, NULL /*update*/, true); -#define DEFAULT_TOKUDB_LOCK_TIMEOUT 4000 /*milliseconds*/ +static const uint64_t DEFAULT_TOKUDB_LOCK_TIMEOUT = 4000; /*milliseconds*/ -static MYSQL_THDVAR_ULONGLONG(lock_timeout, - 0, - "TokuDB lock timeout", - NULL, - NULL, - DEFAULT_TOKUDB_LOCK_TIMEOUT, /*default*/ - 0, /*min*/ - ~0ULL, /*max*/ - 1 /*blocksize*/ -); +static MYSQL_THDVAR_ULONGLONG(lock_timeout, 0, "TokuDB lock timeout", NULL, NULL, DEFAULT_TOKUDB_LOCK_TIMEOUT, 0 /*min*/, ~0ULL /*max*/, 1 /*blocksize*/); static uint64_t tokudb_get_lock_wait_time_callback(uint64_t default_wait_time) { THD *thd = current_thd; @@ -384,6 +375,21 @@ static uint64_t tokudb_get_loader_memory_size_callback(void) { return memory_size; } +static const uint64_t DEFAULT_TOKUDB_KILLED_TIME = 4000; + +static MYSQL_THDVAR_ULONGLONG(killed_time, 0, "TokuDB killed time", NULL, NULL, DEFAULT_TOKUDB_KILLED_TIME, 0 /*min*/, ~0ULL /*max*/, 1 /*blocksize*/); + +static uint64_t tokudb_get_killed_time_callback(uint64_t default_killed_time) { + THD *thd = current_thd; + uint64_t killed_time = THDVAR(thd, killed_time); + return killed_time; +} + +static int tokudb_killed_callback(void) { + THD *thd = current_thd; + return thd->killed; +} + extern HASH tokudb_open_tables; extern pthread_mutex_t tokudb_mutex; extern uint32_t tokudb_write_status_frequency; |