-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-21217 innodb_force_recovery=2 may wrongly abort rollback
trx_roll_must_shutdown(): Correct the condition that detects the start of shutdown.
- Loading branch information
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
mysql-test/suite/innodb/r/innodb_force_recovery_rollback.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,17 @@ | ||
FLUSH TABLES; | ||
# | ||
# MDEV-21217 innodb_force_recovery=2 may wrongly abort the rollback | ||
# of recovered transactions | ||
# | ||
connect con0,localhost,root; | ||
CREATE TABLE t0 (a INT PRIMARY KEY) ENGINE=InnoDB; | ||
BEGIN; | ||
INSERT INTO t0 SELECT * FROM seq_1_to_1000; | ||
connection default; | ||
SET GLOBAL innodb_flush_log_at_trx_commit=1; | ||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; | ||
disconnect con0; | ||
connection default; | ||
SELECT * FROM t0 LOCK IN SHARE MODE; | ||
a | ||
DROP TABLE t0,t1; |
34 changes: 34 additions & 0 deletions
34
mysql-test/suite/innodb/t/innodb_force_recovery_rollback.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,34 @@ | ||
--source include/have_innodb.inc | ||
--source include/have_sequence.inc | ||
|
||
# We will kill and restart the server. | ||
--source include/not_embedded.inc | ||
FLUSH TABLES; | ||
|
||
--echo # | ||
--echo # MDEV-21217 innodb_force_recovery=2 may wrongly abort the rollback | ||
--echo # of recovered transactions | ||
--echo # | ||
|
||
connect (con0,localhost,root); | ||
CREATE TABLE t0 (a INT PRIMARY KEY) ENGINE=InnoDB; | ||
# Create enough undo log so that the rollback may take enough time. | ||
BEGIN; | ||
INSERT INTO t0 SELECT * FROM seq_1_to_1000; | ||
|
||
connection default; | ||
# Persist the above incomplete transaction. | ||
SET GLOBAL innodb_flush_log_at_trx_commit=1; | ||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; | ||
|
||
--let $restart_parameters= --innodb-force-recovery=2 | ||
--let $shutdown_timeout=0 | ||
--source include/restart_mysqld.inc | ||
--let $restart_parameters= | ||
--let $shutdown_timeout= | ||
|
||
disconnect con0; | ||
connection default; | ||
# If the rollback was aborted, we would end up in a lock wait here. | ||
SELECT * FROM t0 LOCK IN SHARE MODE; | ||
DROP TABLE t0,t1; |
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