-
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-25975 innodb_disallow_writes causes shutdown to hang
We will remove the parameter innodb_disallow_writes because it is badly designed and implemented. The parameter was never allowed at startup. It was only internally used by Galera snapshot transfer. If a user executed SET GLOBAL innodb_disallow_writes=ON; the server could hang even on subsequent read operations. During Galera snapshot transfer, we will block writes to implement an rsync friendly snapshot, as follows: sst_flush_tables() will acquire a global lock by executing FLUSH TABLES WITH READ LOCK, which will block any writes at the high level. sst_disable_innodb_writes(), invoked via ha_disable_internal_writes(true), will suspend or disable InnoDB background tasks or threads that could initiate writes. As part of this, log_make_checkpoint() will be invoked to ensure that anything in the InnoDB buf_pool.flush_list will be written to the data files. This has the nice side effect that the Galera joiner will avoid crash recovery. The changes to sql/wsrep.cc and to the tests are based on a prototype that was developed by Jan Lindström. Reviewed by: Jan Lindström
- Loading branch information
Showing
30 changed files
with
229 additions
and
398 deletions.
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 was deleted.
Oops, something went wrong.
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,11 @@ | ||
connection node_1; | ||
connection node_2; | ||
connection node_1; | ||
CREATE TABLE t1 (f1 INT PRIMARY KEY); | ||
connection node_2; | ||
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:.*"); | ||
SET DEBUG_SYNC = 'wsrep_before_certification WAIT_FOR continue'; | ||
INSERT INTO t1 VALUES (1); | ||
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; | ||
connection node_1; | ||
DROP TABLE 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
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
28 changes: 0 additions & 28 deletions
28
mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
This file was deleted.
Oops, something went wrong.
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 @@ | ||
# | ||
# This test verifies that the server can be shut down even if | ||
# some of the wsrep transactions are in QUERY_COMMITTING state. | ||
# In this case the shutdown sequence may do a BF abort for the | ||
# connection. | ||
# | ||
|
||
--source include/have_innodb.inc | ||
--source include/galera_cluster.inc | ||
--source include/have_debug_sync.inc | ||
|
||
# Save original auto_increment_offset values. | ||
--let $node_1=node_1 | ||
--let $node_2=node_2 | ||
--source include/auto_increment_offset_save.inc | ||
|
||
--connection node_1 | ||
CREATE TABLE t1 (f1 INT PRIMARY KEY); | ||
|
||
--connection node_2 | ||
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:.*"); | ||
SET DEBUG_SYNC = 'wsrep_before_certification WAIT_FOR continue'; | ||
--send INSERT INTO t1 VALUES (1) | ||
|
||
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 | ||
--source include/restart_mysqld.inc | ||
|
||
# Restore original auto_increment_offset values. | ||
--let $node_2=node_2a | ||
--source include/auto_increment_offset_restore.inc | ||
|
||
--connection node_1 | ||
|
||
DROP TABLE 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
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
71 changes: 0 additions & 71 deletions
71
mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
mysql-test/suite/sys_vars/r/innodb_disallow_writes_basic.result
This file was deleted.
Oops, something went wrong.
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
42 changes: 0 additions & 42 deletions
42
mysql-test/suite/sys_vars/t/innodb_disallow_writes_basic.test
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.