[Commits] 2b45eb7: MDEV-17261: sysbench oltp read only too slow for MyRocks
revision-id: 2b45eb77f7845068e9e26b30ad63e99ac21c5aff parent(s): 61a6f4bd962dc9c4e36e827bf5897327a85b7f52 committer: Sergei Petrunia branch nick: 10.2-r20 timestamp: 2018-09-23 13:41:08 +0300 message: MDEV-17261: sysbench oltp read only too slow for MyRocks An error in "group commit with MariaDB's binlog" code: we would flush the WAL even when the transaction did not do any writes (and so the logic in myrocks::Rdb_transaction::commit caused it to rollback). --- storage/rocksdb/ha_rocksdb.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 565bbf0..d05f336 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -3753,12 +3753,13 @@ static int rocksdb_commit(handlerton* hton, THD* thd, bool commit_tx) // 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 (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())
participants (1)
-
psergey@askmonty.org