Commit 10f039cd 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 1ab3f292
...@@ -2421,7 +2421,7 @@ cleanup: ...@@ -2421,7 +2421,7 @@ cleanup:
error = sub_trans->commit(sub_trans, DB_TXN_NOSYNC); 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); TOKUDB_DBUG_RETURN(error);
} }
...@@ -2640,7 +2640,7 @@ cleanup: ...@@ -2640,7 +2640,7 @@ cleanup:
error = sub_trans->commit(sub_trans, DB_TXN_NOSYNC); 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); TOKUDB_DBUG_RETURN(error);
} }
...@@ -2762,7 +2762,7 @@ int ha_tokudb::delete_row(const uchar * record) { ...@@ -2762,7 +2762,7 @@ int ha_tokudb::delete_row(const uchar * record) {
thd_proc_info(thd, write_status_msg); 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); TOKUDB_DBUG_RETURN(error);
} }
...@@ -4597,7 +4597,7 @@ int ha_tokudb::rename_table(const char *from, const char *to) { ...@@ -4597,7 +4597,7 @@ int ha_tokudb::rename_table(const char *from, const char *to) {
} }
cleanup: cleanup:
db_env->checkpointing_resume(db_env); assert(!db_env->checkpointing_resume(db_env));
my_free(newfrom, MYF(MY_ALLOW_ZERO_PTR)); my_free(newfrom, MYF(MY_ALLOW_ZERO_PTR));
my_free(newto, MYF(MY_ALLOW_ZERO_PTR)); my_free(newto, MYF(MY_ALLOW_ZERO_PTR));
TOKUDB_DBUG_RETURN(error); TOKUDB_DBUG_RETURN(error);
......
...@@ -104,6 +104,7 @@ static char *tokudb_log_dir; ...@@ -104,6 +104,7 @@ static char *tokudb_log_dir;
static ulong tokudb_max_lock; 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 ulong tokudb_checkpointing_period;
#ifdef TOKUDB_VERSION #ifdef TOKUDB_VERSION
char *tokudb_version = TOKUDB_VERSION; char *tokudb_version = TOKUDB_VERSION;
#else #else
...@@ -315,16 +316,12 @@ bool tokudb_flush_logs(handlerton * hton) { ...@@ -315,16 +316,12 @@ bool tokudb_flush_logs(handlerton * hton) {
TOKUDB_DBUG_ENTER("tokudb_flush_logs"); TOKUDB_DBUG_ENTER("tokudb_flush_logs");
int error; int error;
bool result = 0; bool result = 0;
if (tokudb_init_flags & DB_INIT_LOG) {
if ((error = db_env->log_flush(db_env, 0))) { error = db_env->txn_checkpoint(db_env, 0, 0, 0);
my_error(ER_ERROR_DURING_FLUSH_LOGS, MYF(0), error); if (error) {
result = 1;
}
if ((error = db_env->txn_checkpoint(db_env, 0, 0, 0))) {
my_error(ER_ERROR_DURING_CHECKPOINT, MYF(0), error); my_error(ER_ERROR_DURING_CHECKPOINT, MYF(0), error);
result = 1; result = 1;
} }
}
TOKUDB_DBUG_RETURN(result); TOKUDB_DBUG_RETURN(result);
} }
...@@ -540,6 +537,7 @@ static MYSQL_SYSVAR_STR(version, tokudb_version, PLUGIN_VAR_READONLY, "TokuDB Ve ...@@ -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_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 #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);
...@@ -578,6 +576,7 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = { ...@@ -578,6 +576,7 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = {
MYSQL_SYSVAR(commit_sync), MYSQL_SYSVAR(commit_sync),
MYSQL_SYSVAR(version), MYSQL_SYSVAR(version),
MYSQL_SYSVAR(init_flags), MYSQL_SYSVAR(init_flags),
MYSQL_SYSVAR(checkpointing_period),
#if 0 #if 0
MYSQL_SYSVAR(cache_parts), MYSQL_SYSVAR(cache_parts),
MYSQL_SYSVAR(env_flags), 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