Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TDB-70 : don't do fsync when binlog_group_commit is true #1882

Merged
merged 1 commit into from Aug 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions storage/tokudb/hatoku_hton.cc
Expand Up @@ -772,23 +772,25 @@ bool tokudb_flush_logs(handlerton * hton, bool binlog_group_commit) {
int error;
bool result = 0;

if (tokudb::sysvars::checkpoint_on_flush_logs) {
//
// take the checkpoint
//
// if we are in 'FLUSH LOGS' and we are directed to checkpoint, do a
// checkpoint which also has the effect of flushing logs
if (!binlog_group_commit && tokudb::sysvars::checkpoint_on_flush_logs) {
error = db_env->txn_checkpoint(db_env, 0, 0, 0);
if (error) {
my_error(ER_ERROR_DURING_CHECKPOINT, MYF(0), error);
result = 1;
goto exit;
}
}
else {
// if we are either in 'FLUSH LOGS', or, we are not in 'FLUSH LOGS' but in
// binlog_group_commit and we are in high durability, flush 'em
else if (!binlog_group_commit ||
(tokudb::sysvars::fsync_log_period == 0 &&
tokudb::sysvars::commit_sync(NULL))) {
error = db_env->log_flush(db_env, NULL);
assert_always(error == 0);
}

result = 0;
exit:
TOKUDB_DBUG_RETURN(result);
}
Expand Down