Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS-4744 : crash after alter table drop index is executed on slave #2701

Merged
merged 1 commit into from
Nov 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
CREATE TABLE t1(a INT PRIMARY KEY, b INT, KEY s_k(b)) ENGINE=ROCKSDB;
INSERT INTO t1 VALUES(1,2);
ALTER TABLE t1 DROP KEY s_k;
include/sync_slave_sql_with_master.inc
DROP TABLE t1;
include/rpl_end.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--binlog_format=row --gtid_mode=ON --enforce_gtid_consistency=ON --log-slave-updates=0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--gtid_mode=ON --enforce_gtid_consistency=ON --skip-log-bin --log-slave-updates=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--source include/not_group_replication_plugin.inc
--source include/have_binlog_format_row.inc
--source include/have_rocksdb.inc
--source include/master-slave.inc

connection master;
CREATE TABLE t1(a INT PRIMARY KEY, b INT, KEY s_k(b)) ENGINE=ROCKSDB;

INSERT INTO t1 VALUES(1,2);

ALTER TABLE t1 DROP KEY s_k;

--source include/sync_slave_sql_with_master.inc
connection master;
DROP TABLE t1;

--source include/rpl_end.inc
4 changes: 4 additions & 0 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3068,6 +3068,10 @@ static bool rocksdb_flush_wal(handlerton *const hton
static int rocksdb_prepare(handlerton *const hton, THD *const thd,
bool prepare_tx) {
Rdb_transaction *&tx = get_tx_from_thd(thd);
if (!tx->is_tx_started()) {
// nothing to prepare
return HA_EXIT_SUCCESS;
}
if (!tx->can_prepare()) {
return HA_EXIT_FAILURE;
}
Expand Down