Skip to content

Commit 01e89d6

Browse files
committed
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.
1 parent a128fe4 commit 01e89d6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

storage/rocksdb/ha_rocksdb.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,10 +3154,20 @@ static int rocksdb_commit(handlerton* hton, THD* thd, bool commit_tx)
31543154
- For a COMMIT statement that finishes a multi-statement transaction
31553155
- For a statement that has its own transaction
31563156
*/
3157+
3158+
// First, commit without syncing. This establishes the commit order
3159+
tx->set_sync(false);
31573160
if (tx->commit()) {
31583161
DBUG_RETURN(HA_ERR_ROCKSDB_COMMIT_FAILED);
31593162
}
31603163
thd_wakeup_subsequent_commits(thd, 0);
3164+
3165+
if (rocksdb_flush_log_at_trx_commit == FLUSH_LOG_SYNC)
3166+
{
3167+
rocksdb::Status s= rdb->FlushWAL(true);
3168+
if (!s.ok())
3169+
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
3170+
}
31613171
} else {
31623172
/*
31633173
We get here when committing a statement within a transaction.

0 commit comments

Comments
 (0)