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

addresses #1719, #1718

add variable for checkpointing, address Yoni's CR comments

git-svn-id: file:///svn/mysql/tokudb-engine/src@11470 c7de825b-a66e-492c-adef-691d508d4ae1
parent 65de3911
......@@ -2421,7 +2421,7 @@ int ha_tokudb::write_row(uchar * record) {
error = sub_trans->commit(sub_trans, DB_TXN_NOSYNC);
}
}
db_env->checkpointing_end_atomic_operation(db_env);
assert(!db_env->checkpointing_end_atomic_operation(db_env));
TOKUDB_DBUG_RETURN(error);
}
......@@ -2640,7 +2640,7 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) {
error = sub_trans->commit(sub_trans, DB_TXN_NOSYNC);
}
}
db_env->checkpointing_end_atomic_operation(db_env);
assert(!db_env->checkpointing_end_atomic_operation(db_env));
TOKUDB_DBUG_RETURN(error);
}
......@@ -2762,7 +2762,7 @@ int ha_tokudb::delete_row(const uchar * record) {
thd_proc_info(thd, write_status_msg);
}
}
db_env->checkpointing_end_atomic_operation(db_env);
assert(!db_env->checkpointing_end_atomic_operation(db_env));
TOKUDB_DBUG_RETURN(error);
}
......@@ -4597,7 +4597,7 @@ int ha_tokudb::rename_table(const char *from, const char *to) {
}
cleanup:
db_env->checkpointing_resume(db_env);
assert(!db_env->checkpointing_resume(db_env));
my_free(newfrom, MYF(MY_ALLOW_ZERO_PTR));
my_free(newto, MYF(MY_ALLOW_ZERO_PTR));
TOKUDB_DBUG_RETURN(error);
......
......@@ -104,6 +104,7 @@ static char *tokudb_log_dir;
static ulong tokudb_max_lock;
static const char tokudb_hton_name[] = "TokuDB";
static const int tokudb_hton_name_length = sizeof(tokudb_hton_name) - 1;
static ulong tokudb_checkpointing_period;
#ifdef TOKUDB_VERSION
char *tokudb_version = TOKUDB_VERSION;
#else
......@@ -315,15 +316,11 @@ bool tokudb_flush_logs(handlerton * hton) {
TOKUDB_DBUG_ENTER("tokudb_flush_logs");
int error;
bool result = 0;
if (tokudb_init_flags & DB_INIT_LOG) {
if ((error = db_env->log_flush(db_env, 0))) {
my_error(ER_ERROR_DURING_FLUSH_LOGS, MYF(0), error);
result = 1;
}
if ((error = db_env->txn_checkpoint(db_env, 0, 0, 0))) {
my_error(ER_ERROR_DURING_CHECKPOINT, MYF(0), error);
result = 1;
}
error = db_env->txn_checkpoint(db_env, 0, 0, 0);
if (error) {
my_error(ER_ERROR_DURING_CHECKPOINT, MYF(0), error);
result = 1;
}
TOKUDB_DBUG_RETURN(result);
}
......@@ -540,6 +537,7 @@ 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_ULONG(checkpointing_period, tokudb_checkpointing_period, 0, "TokuDB Checkpointing period", NULL, NULL, 0, 0, ~0L, 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);
......@@ -578,6 +576,7 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = {
MYSQL_SYSVAR(commit_sync),
MYSQL_SYSVAR(version),
MYSQL_SYSVAR(init_flags),
MYSQL_SYSVAR(checkpointing_period),
#if 0
MYSQL_SYSVAR(cache_parts),
MYSQL_SYSVAR(env_flags),
......
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