mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 07:45:44 +00:00
MDEV-27553 Assertion `inited==INDEX' failed: in ha_index_end()
In wsrep_schema code, call ha_index_end() only if the corresponding ha_index_init() call succeeded. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
This commit is contained in:

committed by
Jan Lindström

parent
b915f79e4e
commit
49e3bd2cbc
23
mysql-test/suite/galera_sr/r/MDEV-27553.result
Normal file
23
mysql-test/suite/galera_sr/r/MDEV-27553.result
Normal file
@ -0,0 +1,23 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
|
||||
connection node_1;
|
||||
SET SESSION wsrep_trx_fragment_size=1;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SET @@global.debug_dbug="+d,ha_index_init_fail";
|
||||
ROLLBACK;
|
||||
connection node_2;
|
||||
SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log;
|
||||
Expect 0
|
||||
0
|
||||
connection node_1;
|
||||
SET @@global.debug_dbug="";
|
||||
SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log;
|
||||
Expect 1
|
||||
1
|
||||
SET SESSION wsrep_on=OFF;
|
||||
DELETE FROM mysql.wsrep_streaming_log;
|
||||
SET SESSION wsrep_on=ON;
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("WSREP: Failed to init table for index scan");
|
32
mysql-test/suite/galera_sr/t/MDEV-27553.test
Normal file
32
mysql-test/suite/galera_sr/t/MDEV-27553.test
Normal file
@ -0,0 +1,32 @@
|
||||
#
|
||||
# MDEV-27553 Assertion `inited==INDEX' failed: int handler::ha_index_end()
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
|
||||
|
||||
--connection node_1
|
||||
--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
|
||||
SET SESSION wsrep_trx_fragment_size=1;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# This will result in failure to remove fragments
|
||||
# from streaming log, in the following ROLLBACK.
|
||||
SET @@global.debug_dbug="+d,ha_index_init_fail";
|
||||
ROLLBACK;
|
||||
|
||||
--connection node_2
|
||||
SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log;
|
||||
|
||||
|
||||
--connection node_1
|
||||
SET @@global.debug_dbug="";
|
||||
SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log;
|
||||
|
||||
SET SESSION wsrep_on=OFF;
|
||||
DELETE FROM mysql.wsrep_streaming_log;
|
||||
SET SESSION wsrep_on=ON;
|
||||
DROP TABLE t1;
|
||||
|
||||
CALL mtr.add_suppression("WSREP: Failed to init table for index scan");
|
@ -598,9 +598,11 @@ static int init_for_index_scan(TABLE* table, const uchar* key,
|
||||
*/
|
||||
static int end_index_scan(TABLE* table) {
|
||||
int error;
|
||||
if ((error= table->file->ha_index_end())) {
|
||||
WSREP_ERROR("Failed to end scan: %d", error);
|
||||
return 1;
|
||||
if (table->file->inited) {
|
||||
if ((error= table->file->ha_index_end())) {
|
||||
WSREP_ERROR("Failed to end scan: %d", error);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Submodule wsrep-lib updated: 6fd1fdf690...da5098b622
Reference in New Issue
Block a user