Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-25305: MyRocks: Killing server during RESET MASTER can lose last…
… transactions rocksdb_checkpoint_request() should call FlushWAL(sync=true) (which does write-out and sync), not just SyncWAL() (which just syncs without writing out) Followup: the test requires debug sync facility (This is a backport to 10.5)
- Loading branch information
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
storage/rocksdb/mysql-test/rocksdb/r/binlog_rotate_crash.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# | ||
# MDEV-25305: MyRocks: Killing server during RESET MASTER can lose last transactions | ||
# | ||
set global rocksdb_flush_log_at_trx_commit=1; | ||
create table t1 (a int, b int, key(a)) engine=rocksdb; | ||
insert into t1 values (1,1),(2,2); | ||
select * from t1; | ||
a b | ||
1 1 | ||
2 2 | ||
flush tables; | ||
set @@debug_dbug="+d,crash_after_reset_master"; | ||
RESET MASTER; | ||
# Must show the inserted rows: | ||
select * from t1; | ||
a b | ||
1 1 | ||
2 2 | ||
drop table t1; |
31 changes: 31 additions & 0 deletions
31
storage/rocksdb/mysql-test/rocksdb/t/binlog_rotate_crash.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--source include/have_rocksdb.inc | ||
--source include/have_log_bin.inc | ||
--source include/have_debug_sync.inc | ||
|
||
--echo # | ||
--echo # MDEV-25305: MyRocks: Killing server during RESET MASTER can lose last transactions | ||
--echo # | ||
|
||
set global rocksdb_flush_log_at_trx_commit=1; | ||
|
||
create table t1 (a int, b int, key(a)) engine=rocksdb; | ||
insert into t1 values (1,1),(2,2); | ||
select * from t1; | ||
flush tables; | ||
|
||
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
restart | ||
EOF | ||
|
||
set @@debug_dbug="+d,crash_after_reset_master"; | ||
|
||
--disable_reconnect | ||
--error 0,2013 | ||
RESET MASTER; | ||
--enable_reconnect | ||
--source include/wait_until_connected_again.inc | ||
--echo # Must show the inserted rows: | ||
select * from t1; | ||
|
||
drop table t1; | ||
|