Commit 80d61515 authored by Sergei Petrunia's avatar Sergei Petrunia

Make rocksdb.read_only_tx pass and enable it

- FB/MySQL 5.6' MyRocks has START TRANSACTION WITH CONSISTENT
  ROCKSDB SNAPSHOT, which returns binlog position.

- MariaDB has a cross-engine START TRANSACTION WITH CONSISTENT
  SNAPSHOT. It can be used for the same purpose. Binlog position
  can be obtained from Binlog_snapshot_file/position status vars.
parent bd20fb87
DROP TABLE IF EXISTS t1;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connection con1;
CREATE TABLE t1 (id INT, value int, PRIMARY KEY (id), INDEX (value)) ENGINE=RocksDB;
INSERT INTO t1 VALUES (1,1);
select variable_value into @p from information_schema.global_status where variable_name='rocksdb_number_sst_entry_put';
select variable_value into @s from information_schema.global_status where variable_name='rocksdb_number_sst_entry_singledelete';
START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT;
File Position Gtid_executed
master-bin.000001 734 uuid:1-3
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection con2;
connection con1;
select case when variable_value-@p < 1000 then 'true' else variable_value-@p end from information_schema.global_status where variable_name='rocksdb_number_sst_entry_put';
case when variable_value-@p < 1000 then 'true' else variable_value-@p end
true
......@@ -27,10 +30,15 @@ id value
1 10001
2 2
BEGIN;
connection con2;
connection con1;
SELECT COUNT(*) FROM t1;
COUNT(*)
9998
COMMIT;
connection default;
disconnect con1;
disconnect con2;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
......
......@@ -80,7 +80,7 @@ blind_delete_without_tx_api: MDEV-12286: rocksdb.blind_delete_without_tx_api tes
##
information_schema : MariaRocks: requires GTIDs
mysqlbinlog_gtid_skip_empty_trans_rocksdb : MariaRocks: requires GTIDs
read_only_tx : MariaRocks: requires GTIDs
#read_only_tx : MariaRocks: requires GTIDs
rpl_row_triggers : MariaRocks: requires GTIDs
--rocksdb_default_cf_options=write_buffer_size=16k --log-bin --binlog_format=row --gtid_mode=ON --enforce_gtid_consistency --log-slave-updates
--rocksdb_default_cf_options=write_buffer_size=16k --log-bin --binlog_format=row --log-slave-updates
......@@ -2,9 +2,9 @@
--source include/have_rocksdb.inc
--source include/count_sessions.inc
--disable_warnings
--source include/have_gtid.inc
#--source include/have_gtid.inc
--enable_warnings
-- let $uuid = `select @@server_uuid;`
#-- let $uuid = `select @@server_uuid;`
--disable_warnings
DROP TABLE IF EXISTS t1;
......@@ -20,8 +20,8 @@ INSERT INTO t1 VALUES (1,1);
# Read-only, long-running transaction. SingleDelete/Put shouldn't increase much.
select variable_value into @p from information_schema.global_status where variable_name='rocksdb_number_sst_entry_put';
select variable_value into @s from information_schema.global_status where variable_name='rocksdb_number_sst_entry_singledelete';
-- replace_result $uuid uuid
START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT;
#-- replace_result $uuid uuid
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection con2;
--disable_query_log
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment