-
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-25089 : Assertion `error.len > 0' failed in galera::ReplicatorSM…
…M::handle_apply_error() Problem is that Galera starts TOI (total order isolation) i.e. it sends query to all nodes. Later it is discovered that used engine or other feature is not supported by Galera. Because TOI is executed parallelly in all nodes appliers could execute given TOI and ignore the error and start inconsistency voting causing node to leave from cluster or we might have a crash as reported. For example SEQUENCE engine does not support GEOMETRY data type causing either inconsistency between nodes (because some errors are ignored on applier) or crash. Fixed my adding new function wsrep_check_support to check can Galera support provided CREATE TABLE/SEQUENCE before TOI is started and if not clear error message is provided to the user. Currently, not supported cases: * CREATE TABLE ... AS SELECT when streaming replication is used * CREATE TABLE ... WITH SYSTEM VERSIONING AS SELECT * CREATE TABLE ... ENGINE=SEQUENCE * CREATE SEQUENCE ... ENGINE!=InnoDB * ALTER TABLE t ... ENGINE!=InnoDB where table t is SEQUENCE Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
- Loading branch information
1 parent
3228c08
commit daaa16a
Showing
9 changed files
with
121 additions
and
83 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 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,12 @@ | ||
connection node_2; | ||
connection node_1; | ||
SET GLOBAL wsrep_ignore_apply_errors=0; | ||
SET SESSION AUTOCOMMIT=0; | ||
SET SESSION max_error_count=0; | ||
CREATE TABLE t0 (id GEOMETRY,parent_id GEOMETRY)ENGINE=SEQUENCE; | ||
ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' | ||
connection node_2; | ||
SHOW CREATE TABLE t0; | ||
ERROR 42S02: Table 'test.t0' doesn't exist | ||
connection node_1; | ||
SET GLOBAL wsrep_ignore_apply_errors=DEFAULT; |
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 |
---|---|---|
@@ -1,23 +1,8 @@ | ||
connection node_2; | ||
connection node_1; | ||
connection node_1; | ||
connection node_2; | ||
connection node_1; | ||
CREATE TABLE t ENGINE=InnoDB WITH SYSTEM VERSIONING AS SELECT 1 AS i; | ||
SHOW CREATE TABLE t; | ||
Table Create Table | ||
t CREATE TABLE `t` ( | ||
`i` int(1) NOT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING | ||
SELECT * from t; | ||
i | ||
1 | ||
DROP TABLE IF EXISTS t; | ||
COMMIT; | ||
ERROR 42000: This version of MariaDB doesn't yet support 'SYSTEM VERSIONING AS SELECT in Galera cluster' | ||
connection node_2; | ||
SET SESSION wsrep_sync_wait=0; | ||
Killing server ... | ||
Starting server ... | ||
connection node_2; | ||
call mtr.add_suppression("WSREP: Event .*Write_rows_v1 apply failed:.*"); | ||
call mtr.add_suppression("SREP: Failed to apply write set: gtid:.*"); | ||
SHOW CREATE TABLE t; | ||
ERROR 42S02: Table 'test.t' doesn't exist |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--source include/galera_cluster.inc | ||
--source include/have_sequence.inc | ||
|
||
SET GLOBAL wsrep_ignore_apply_errors=0; | ||
SET SESSION AUTOCOMMIT=0; | ||
SET SESSION max_error_count=0; | ||
--error ER_NOT_SUPPORTED_YET | ||
CREATE TABLE t0 (id GEOMETRY,parent_id GEOMETRY)ENGINE=SEQUENCE; | ||
|
||
--connection node_2 | ||
--error ER_NO_SUCH_TABLE | ||
SHOW CREATE TABLE t0; | ||
|
||
--connection node_1 | ||
SET GLOBAL wsrep_ignore_apply_errors=DEFAULT; | ||
|
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 |
---|---|---|
@@ -1,34 +1,15 @@ | ||
--source include/galera_cluster.inc | ||
|
||
--let $node_1 = node_1 | ||
--let $node_2 = node_2 | ||
--source include/auto_increment_offset_save.inc | ||
|
||
--connection node_1 | ||
CREATE TABLE t ENGINE=InnoDB WITH SYSTEM VERSIONING AS SELECT 1 AS i; | ||
SHOW CREATE TABLE t; | ||
SELECT * from t; | ||
DROP TABLE IF EXISTS t; | ||
COMMIT; | ||
|
||
# | ||
# Restart node_2, force SST because database is inconsistent compared to node_1 | ||
# Below should not cause nodes to be inconsistent (they could if we | ||
# allow TOI as some error are ignored on applier | ||
# | ||
--connection node_2 | ||
SET SESSION wsrep_sync_wait=0; | ||
--source include/kill_galera.inc | ||
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat | ||
--echo Starting server ... | ||
let $restart_noprint=2; | ||
--source include/start_mysqld.inc | ||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; | ||
--source include/wait_condition.inc | ||
|
||
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; | ||
--source include/wait_condition.inc | ||
--error ER_NOT_SUPPORTED_YET | ||
CREATE TABLE t ENGINE=InnoDB WITH SYSTEM VERSIONING AS SELECT 1 AS i; | ||
|
||
--connection node_2 | ||
call mtr.add_suppression("WSREP: Event .*Write_rows_v1 apply failed:.*"); | ||
call mtr.add_suppression("SREP: Failed to apply write set: gtid:.*"); | ||
--error ER_NO_SUCH_TABLE | ||
SHOW CREATE TABLE t; | ||
|
||
|
||
--source include/auto_increment_offset_restore.inc |
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