diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2018-02-21 15:42:34 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2018-02-21 15:42:34 +0300 |
commit | 01e89d6a86ddc26da29ad530e74c20cee0529fa5 (patch) | |
tree | 0536ecc26ba5cf03344eb81875e905d7835ffed9 | |
parent | a128fe4346a466aa8e059baa620a3b689fa21241 (diff) | |
download | mariadb-git-01e89d6a86ddc26da29ad530e74c20cee0529fa5.tar.gz |
MDEV-15372: Parallel slave speedup very limited when log_slave_updates=OFF
Make MyRocks' non-XA commit path to first do the commit without syncing
and then sync.
-rw-r--r-- | storage/rocksdb/ha_rocksdb.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 4a0a3eddb1a..0231dce7cf5 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -3154,10 +3154,20 @@ static int rocksdb_commit(handlerton* hton, THD* thd, bool commit_tx) - For a COMMIT statement that finishes a multi-statement transaction - For a statement that has its own transaction */ + + // First, commit without syncing. This establishes the commit order + tx->set_sync(false); if (tx->commit()) { DBUG_RETURN(HA_ERR_ROCKSDB_COMMIT_FAILED); } thd_wakeup_subsequent_commits(thd, 0); + + if (rocksdb_flush_log_at_trx_commit == FLUSH_LOG_SYNC) + { + rocksdb::Status s= rdb->FlushWAL(true); + if (!s.ok()) + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + } } else { /* We get here when committing a statement within a transaction. |