Commit ffafecce authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2614], make tokudb_prelock_empty a session variable

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@20227 c7de825b-a66e-492c-adef-691d508d4ae1
parent a4ae3a50
......@@ -2850,7 +2850,7 @@ void ha_tokudb::start_bulk_insert(ha_rows rows) {
ai_metadata_update_required = false;
abort_loader = false;
if (share->try_table_lock) {
if (tokudb_prelock_empty && may_table_be_empty()) {
if (get_prelock_empty(thd) && may_table_be_empty()) {
if (using_ignore || get_load_save_space(thd)) {
acquire_table_lock(transaction, lock_write);
}
......
......@@ -91,6 +91,13 @@ static MYSQL_THDVAR_BOOL(load_save_space,
NULL,
FALSE
);
static MYSQL_THDVAR_BOOL(prelock_empty,
0,
"Tokudb Prelock Empty Table",
NULL,
NULL,
TRUE
);
static void tokudb_print_error(const DB_ENV * db_env, const char *db_errpfx, const char *buffer);
......@@ -144,7 +151,6 @@ static const int tokudb_hton_name_length = sizeof(tokudb_hton_name) - 1;
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;
#ifdef TOKUDB_VERSION
char *tokudb_version = (char*) TOKUDB_VERSION;
#else
......@@ -497,6 +503,9 @@ bool get_load_save_space(THD* thd) {
return (THDVAR(thd, load_save_space) != 0);
}
bool get_prelock_empty(THD* thd) {
return (THDVAR(thd, prelock_empty) != 0);
}
typedef struct txn_progress_info {
char status[200];
......@@ -1179,7 +1188,6 @@ static MYSQL_SYSVAR_STR(version, tokudb_version, PLUGIN_VAR_READONLY, "TokuDB Ve
static MYSQL_SYSVAR_UINT(init_flags, tokudb_init_flags, PLUGIN_VAR_READONLY, "Sets TokuDB DB_ENV->open flags", NULL, NULL, tokudb_init_flags, 0, ~0, 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 Prelock Empty Table", 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);
static MYSQL_SYSVAR_INT(fs_reserve_percent, tokudb_fs_reserve_percent, PLUGIN_VAR_READONLY, "TokuDB file system space reserve (percent free required)", NULL, NULL, 5, 0, 100, 0);
......
......@@ -15,11 +15,11 @@ ulonglong get_write_lock_wait_time (THD* thd);
ulonglong get_read_lock_wait_time (THD* thd);
uint get_pk_insert_mode(THD* thd);
bool get_load_save_space(THD* thd);
bool get_prelock_empty(THD* thd);
extern HASH tokudb_open_tables;
extern pthread_mutex_t tokudb_mutex;
extern pthread_mutex_t tokudb_meta_mutex;
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
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