Skip to content
Browse files

MariaRocks port: Remove ifdef MARIAROCKS_NOT_YET in rocksdb_start_tx_…


Looked though the code: MariaDB's method of doing START TRANSACTION
WITH CONSISTENT SNAPSHOT doesn't require mysql_bin_log_lock_commits
  • Loading branch information...
spetrunia committed Dec 26, 2016
1 parent 9f7dc2b commit 122bc4b54cec54cbaa259f6f3b63d2d836b694ec
Showing with 11 additions and 20 deletions.
  1. +11 −20 storage/rocksdb/
@@ -3099,12 +3099,6 @@ static int rocksdb_start_tx_and_assign_read_view(
THD* thd) /*!< in: MySQL thread handle of the
user for whom the transaction should
be committed */
#ifdef MARIAROCKS_NOT_YET // consistent snapshot with binlog
char* binlog_file, /* out: binlog file for last commit */
ulonglong* binlog_pos, /* out: binlog pos for last commit */
char** gtid_executed, /* out: Gtids logged until last commit */
int* gtid_executed_length) /*out: Length of gtid_executed string */
Rdb_perf_context_guard guard(thd);

@@ -3118,26 +3112,23 @@ static int rocksdb_start_tx_and_assign_read_view(
"in RocksDB Storage Engine.", MYF(0));
return 1;
#ifdef MARIAROCKS_NOT_YET // consistent snapshot with binlog
if (binlog_file)
if (binlog_pos && mysql_bin_log.is_open())
return 1;
MariaDB: there is no need to call mysql_bin_log_lock_commits and then
unlock back.
SQL layer calls start_consistent_snapshot() for all engines, including the
binlog under LOCK_commit_ordered mutex.
The mutex prevents binlog commits from happening (right?) while the storage
engine(s) allocate read snapshots. That way, each storage engine is
synchronized with current binlog position.

Rdb_transaction* tx= get_or_create_tx(thd);
rocksdb_register_tx(hton, thd, tx);

#ifdef MARIAROCKS_NOT_YET // consistent snapshot with binlog
if (binlog_file)
mysql_bin_log_unlock_commits(binlog_file, binlog_pos, gtid_executed,
return 0;

0 comments on commit 122bc4b

Please sign in to comment.
You can’t perform that action at this time.