summaryrefslogtreecommitdiff
path: root/storage/rocksdb
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2019-03-28 15:54:42 +0300
committerSergei Petrunia <psergey@askmonty.org>2019-03-28 19:51:40 +0300
commit8fcd9478cc6fdb1d4cdb84a552d7dcf8e6f596d3 (patch)
tree2b4b97982712d845bc5b0479e4539051c8389173 /storage/rocksdb
parente42192d7b3821640bcf18c58dc303a2338c6d1aa (diff)
downloadmariadb-git-8fcd9478cc6fdb1d4cdb84a552d7dcf8e6f596d3.tar.gz
MDEV-18080, part#1: MyRocks is slow with log-bin=off
The cause for this was fix MDEV-15372, which was trying to speed up the parallel slave. Part#1: Do not attempt the "optimization" for transactions that are not replication slave workers.
Diffstat (limited to 'storage/rocksdb')
-rw-r--r--storage/rocksdb/ha_rocksdb.cc34
1 files changed, 23 insertions, 11 deletions
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 6ce00cb4d1c..022511320a6 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -3750,20 +3750,32 @@ 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
*/
+ if (thd->slave_thread)
+ {
+ // An attempt to make parallel slave performant (not fully successful,
+ // see MDEV-15372):
- // First, commit without syncing. This establishes the commit order
- tx->set_sync(false);
- bool tx_had_writes = tx->get_write_count()? true : false ;
- if (tx->commit()) {
- DBUG_RETURN(HA_ERR_ROCKSDB_COMMIT_FAILED);
- }
- thd_wakeup_subsequent_commits(thd, 0);
+ // First, commit without syncing. This establishes the commit order
+ tx->set_sync(false);
+ bool tx_had_writes = tx->get_write_count()? true : false ;
+ if (tx->commit()) {
+ DBUG_RETURN(HA_ERR_ROCKSDB_COMMIT_FAILED);
+ }
+ thd_wakeup_subsequent_commits(thd, 0);
- if (tx_had_writes && rocksdb_flush_log_at_trx_commit == FLUSH_LOG_SYNC)
+ if (tx_had_writes && 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
{
- rocksdb::Status s= rdb->FlushWAL(true);
- if (!s.ok())
- DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
+ /* Not a slave thread */
+ if (tx->commit()) {
+ DBUG_RETURN(HA_ERR_ROCKSDB_COMMIT_FAILED);
+ }
}
} else {
/*