Commit 5e5b2089 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2048], add user variables that control how often status gets updated

git-svn-id: file:///svn/mysql/tokudb-engine/src@14786 c7de825b-a66e-492c-adef-691d508d4ae1
parent be3509f5
...@@ -3965,10 +3965,10 @@ cleanup: ...@@ -3965,10 +3965,10 @@ cleanup:
void ha_tokudb::track_progress(THD* thd) { void ha_tokudb::track_progress(THD* thd) {
tokudb_trx_data* trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot); tokudb_trx_data* trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot);
if (trx) { if (trx) {
bool update_status = (trx->stmt_progress.queried % 10000) == 1 || ulonglong num_written = trx->stmt_progress.inserted + trx->stmt_progress.inserted + trx->stmt_progress.inserted;
(trx->stmt_progress.inserted% 1000) == 1 || bool update_status =
(trx->stmt_progress.updated% 1000) == 1 || (tokudb_read_status_frequency && (trx->stmt_progress.queried % tokudb_read_status_frequency) == 1) ||
(trx->stmt_progress.deleted% 1000) == 1; (tokudb_write_status_frequency && (num_written) % tokudb_write_status_frequency == 1);
if (update_status) { if (update_status) {
sprintf( sprintf(
write_status_msg, write_status_msg,
......
...@@ -102,6 +102,8 @@ static ulong tokudb_max_lock; ...@@ -102,6 +102,8 @@ static ulong tokudb_max_lock;
static const char tokudb_hton_name[] = "TokuDB"; static const char tokudb_hton_name[] = "TokuDB";
static const int tokudb_hton_name_length = sizeof(tokudb_hton_name) - 1; static const int tokudb_hton_name_length = sizeof(tokudb_hton_name) - 1;
static u_int32_t tokudb_checkpointing_period; static u_int32_t tokudb_checkpointing_period;
u_int32_t tokudb_write_status_frequency;
u_int32_t tokudb_read_status_frequency;
my_bool tokudb_prelock_empty; my_bool tokudb_prelock_empty;
#ifdef TOKUDB_VERSION #ifdef TOKUDB_VERSION
char *tokudb_version = TOKUDB_VERSION; char *tokudb_version = TOKUDB_VERSION;
...@@ -883,6 +885,8 @@ static MYSQL_SYSVAR_UINT(init_flags, tokudb_init_flags, PLUGIN_VAR_READONLY, "Se ...@@ -883,6 +885,8 @@ static MYSQL_SYSVAR_UINT(init_flags, tokudb_init_flags, PLUGIN_VAR_READONLY, "Se
static MYSQL_SYSVAR_UINT(checkpointing_period, tokudb_checkpointing_period, 0, "TokuDB Checkpointing period", NULL, NULL, 60, 0, ~0L, 0); static MYSQL_SYSVAR_UINT(checkpointing_period, tokudb_checkpointing_period, 0, "TokuDB Checkpointing period", NULL, NULL, 60, 0, ~0L, 0);
static MYSQL_SYSVAR_BOOL(prelock_empty, tokudb_prelock_empty, 0, "Tokudb Shared Data", NULL, NULL, TRUE); static MYSQL_SYSVAR_BOOL(prelock_empty, tokudb_prelock_empty, 0, "Tokudb Shared Data", NULL, NULL, TRUE);
static MYSQL_SYSVAR_UINT(write_status_frequency, tokudb_write_status_frequency, 0, "TokuDB frequency that show processlist updates status of writes", NULL, NULL, 1000, 0, ~0L, 0);
static MYSQL_SYSVAR_UINT(read_status_frequency, tokudb_read_status_frequency, 0, "TokuDB frequency that show processlist updates status of reads", NULL, NULL, 10000, 0, ~0L, 0);
#if 0 #if 0
static MYSQL_SYSVAR_ULONG(cache_parts, tokudb_cache_parts, PLUGIN_VAR_READONLY, "Sets TokuDB set_cache_parts", NULL, NULL, 0, 0, ~0L, 0); static MYSQL_SYSVAR_ULONG(cache_parts, tokudb_cache_parts, PLUGIN_VAR_READONLY, "Sets TokuDB set_cache_parts", NULL, NULL, 0, 0, ~0L, 0);
...@@ -923,6 +927,8 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = { ...@@ -923,6 +927,8 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = {
MYSQL_SYSVAR(init_flags), MYSQL_SYSVAR(init_flags),
MYSQL_SYSVAR(checkpointing_period), MYSQL_SYSVAR(checkpointing_period),
MYSQL_SYSVAR(prelock_empty), MYSQL_SYSVAR(prelock_empty),
MYSQL_SYSVAR(write_status_frequency),
MYSQL_SYSVAR(read_status_frequency),
#if 0 #if 0
MYSQL_SYSVAR(cache_parts), MYSQL_SYSVAR(cache_parts),
MYSQL_SYSVAR(env_flags), MYSQL_SYSVAR(env_flags),
......
...@@ -17,5 +17,6 @@ extern HASH tokudb_open_tables; ...@@ -17,5 +17,6 @@ extern HASH tokudb_open_tables;
extern pthread_mutex_t tokudb_mutex; extern pthread_mutex_t tokudb_mutex;
extern pthread_mutex_t tokudb_meta_mutex; extern pthread_mutex_t tokudb_meta_mutex;
extern my_bool tokudb_prelock_empty; extern my_bool tokudb_prelock_empty;
extern u_int32_t tokudb_write_status_frequency;
extern u_int32_t tokudb_read_status_frequency;
#endif //#ifdef _HATOKU_HTON #endif //#ifdef _HATOKU_HTON
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment