Commit 913efaa3 authored by Jan Lindström's avatar Jan Lindström

MDEV-26566 : galera.galera_var_cluster_address MTR failed: InnoDB: Assertion...

MDEV-26566 : galera.galera_var_cluster_address MTR failed: InnoDB: Assertion failure in file row0ins.cc line 3206

Actual problem was that we tried to calculate persistent statistics
to wsrep_schema tables in this case wsrep_streaming_log. These tables
should not have persistent statistics. Therefore, in table creation
tables should be created with STATS_PERSISTENT=0 table option. During
rolling-upgrade tables naturally already exists, thus we need to
alter them to contain STATS_PERSISTENT=0 table option.
parent c8c21a4c
connection node_2;
connection node_1;
CREATE TABLE IF NOT EXISTS wsrep_cluster
(
cluster_uuid CHAR(36) PRIMARY KEY,
view_id BIGINT NOT NULL,
view_seqno BIGINT NOT NULL,
protocol_version INT NOT NULL,
capabilities INT NOT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS wsrep_cluster_members
(
node_uuid CHAR(36) PRIMARY KEY,
cluster_uuid CHAR(36) NOT NULL,
node_name CHAR(32) NOT NULL,
node_incoming_address VARCHAR(256) NOT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS wsrep_cluster_members_history
(
node_uuid CHAR(36) PRIMARY KEY,
cluster_uuid CHAR(36) NOT NULL,
last_view_id BIGINT NOT NULL,
last_view_seqno BIGINT NOT NULL,
node_name CHAR(32) NOT NULL,
node_incoming_address VARCHAR(256) NOT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS wsrep_streaming_log
(
node_uuid CHAR(36),
trx_id BIGINT,
seqno BIGINT,
flags INT NOT NULL,
frag LONGBLOB NOT NULL,
PRIMARY KEY (node_uuid, trx_id, seqno)
) ENGINE=InnoDB;
DELETE FROM wsrep_cluster;
DELETE FROM wsrep_cluster_members;
ALTER TABLE wsrep_cluster STATS_PERSISTENT=0;
ALTER TABLE wsrep_cluster_members STATS_PERSISTENT=0;
ALTER TABLE wsrep_cluster_members_history STATS_PERSISTENT=0;
ALTER TABLE wsrep_streaming_log STATS_PERSISTENT=0;
SHOW CREATE TABLE wsrep_cluster;
Table Create Table
wsrep_cluster CREATE TABLE `wsrep_cluster` (
`cluster_uuid` char(36) NOT NULL,
`view_id` bigint(20) NOT NULL,
`view_seqno` bigint(20) NOT NULL,
`protocol_version` int(11) NOT NULL,
`capabilities` int(11) NOT NULL,
PRIMARY KEY (`cluster_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SHOW CREATE TABLE wsrep_cluster_members;
Table Create Table
wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` (
`node_uuid` char(36) NOT NULL,
`cluster_uuid` char(36) NOT NULL,
`node_name` char(32) NOT NULL,
`node_incoming_address` varchar(256) NOT NULL,
PRIMARY KEY (`node_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SHOW CREATE TABLE wsrep_cluster_members_history;
Table Create Table
wsrep_cluster_members_history CREATE TABLE `wsrep_cluster_members_history` (
`node_uuid` char(36) NOT NULL,
`cluster_uuid` char(36) NOT NULL,
`last_view_id` bigint(20) NOT NULL,
`last_view_seqno` bigint(20) NOT NULL,
`node_name` char(32) NOT NULL,
`node_incoming_address` varchar(256) NOT NULL,
PRIMARY KEY (`node_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SHOW CREATE TABLE wsrep_streaming_log;
Table Create Table
wsrep_streaming_log CREATE TABLE `wsrep_streaming_log` (
`node_uuid` char(36) NOT NULL,
`trx_id` bigint(20) NOT NULL,
`seqno` bigint(20) NOT NULL,
`flags` int(11) NOT NULL,
`frag` longblob NOT NULL,
PRIMARY KEY (`node_uuid`,`trx_id`,`seqno`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SHOW CREATE TABLE mysql.wsrep_cluster;
Table Create Table
wsrep_cluster CREATE TABLE `wsrep_cluster` (
`cluster_uuid` char(36) NOT NULL,
`view_id` bigint(20) NOT NULL,
`view_seqno` bigint(20) NOT NULL,
`protocol_version` int(11) NOT NULL,
`capabilities` int(11) NOT NULL,
PRIMARY KEY (`cluster_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SHOW CREATE TABLE mysql.wsrep_cluster_members;
Table Create Table
wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` (
`node_uuid` char(36) NOT NULL,
`cluster_uuid` char(36) NOT NULL,
`node_name` char(32) NOT NULL,
`node_incoming_address` varchar(256) NOT NULL,
PRIMARY KEY (`node_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SHOW CREATE TABLE mysql.wsrep_streaming_log;
Table Create Table
wsrep_streaming_log CREATE TABLE `wsrep_streaming_log` (
`node_uuid` char(36) NOT NULL,
`trx_id` bigint(20) NOT NULL,
`seqno` bigint(20) NOT NULL,
`flags` int(11) NOT NULL,
`frag` longblob NOT NULL,
PRIMARY KEY (`node_uuid`,`trx_id`,`seqno`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
DROP TABLE wsrep_cluster;
DROP TABLE wsrep_cluster_members;
DROP TABLE wsrep_cluster_members_history;
DROP TABLE wsrep_streaming_log;
--source include/galera_cluster.inc
CREATE TABLE IF NOT EXISTS wsrep_cluster
(
cluster_uuid CHAR(36) PRIMARY KEY,
view_id BIGINT NOT NULL,
view_seqno BIGINT NOT NULL,
protocol_version INT NOT NULL,
capabilities INT NOT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS wsrep_cluster_members
(
node_uuid CHAR(36) PRIMARY KEY,
cluster_uuid CHAR(36) NOT NULL,
node_name CHAR(32) NOT NULL,
node_incoming_address VARCHAR(256) NOT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS wsrep_cluster_members_history
(
node_uuid CHAR(36) PRIMARY KEY,
cluster_uuid CHAR(36) NOT NULL,
last_view_id BIGINT NOT NULL,
last_view_seqno BIGINT NOT NULL,
node_name CHAR(32) NOT NULL,
node_incoming_address VARCHAR(256) NOT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS wsrep_streaming_log
(
node_uuid CHAR(36),
trx_id BIGINT,
seqno BIGINT,
flags INT NOT NULL,
frag LONGBLOB NOT NULL,
PRIMARY KEY (node_uuid, trx_id, seqno)
) ENGINE=InnoDB;
DELETE FROM wsrep_cluster;
DELETE FROM wsrep_cluster_members;
ALTER TABLE wsrep_cluster STATS_PERSISTENT=0;
ALTER TABLE wsrep_cluster_members STATS_PERSISTENT=0;
ALTER TABLE wsrep_cluster_members_history STATS_PERSISTENT=0;
ALTER TABLE wsrep_streaming_log STATS_PERSISTENT=0;
SHOW CREATE TABLE wsrep_cluster;
SHOW CREATE TABLE wsrep_cluster_members;
SHOW CREATE TABLE wsrep_cluster_members_history;
SHOW CREATE TABLE wsrep_streaming_log;
SHOW CREATE TABLE mysql.wsrep_cluster;
SHOW CREATE TABLE mysql.wsrep_cluster_members;
#SHOW CREATE TABLE mysql.wsrep_cluster_members_history;
SHOW CREATE TABLE mysql.wsrep_streaming_log;
DROP TABLE wsrep_cluster;
DROP TABLE wsrep_cluster_members;
DROP TABLE wsrep_cluster_members_history;
DROP TABLE wsrep_streaming_log;
...@@ -14,7 +14,7 @@ wsrep_cluster CREATE TABLE `wsrep_cluster` ( ...@@ -14,7 +14,7 @@ wsrep_cluster CREATE TABLE `wsrep_cluster` (
`protocol_version` int(11) NOT NULL, `protocol_version` int(11) NOT NULL,
`capabilities` int(11) NOT NULL, `capabilities` int(11) NOT NULL,
PRIMARY KEY (`cluster_uuid`) PRIMARY KEY (`cluster_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SHOW CREATE TABLE mysql.wsrep_cluster_members; SHOW CREATE TABLE mysql.wsrep_cluster_members;
Table Create Table Table Create Table
wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` ( wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` (
...@@ -23,7 +23,7 @@ wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` ( ...@@ -23,7 +23,7 @@ wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` (
`node_name` char(32) NOT NULL, `node_name` char(32) NOT NULL,
`node_incoming_address` varchar(256) NOT NULL, `node_incoming_address` varchar(256) NOT NULL,
PRIMARY KEY (`node_uuid`) PRIMARY KEY (`node_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster;
EXPECT_1 EXPECT_1
1 1
......
...@@ -14,7 +14,7 @@ wsrep_cluster CREATE TABLE `wsrep_cluster` ( ...@@ -14,7 +14,7 @@ wsrep_cluster CREATE TABLE `wsrep_cluster` (
`protocol_version` int(11) NOT NULL, `protocol_version` int(11) NOT NULL,
`capabilities` int(11) NOT NULL, `capabilities` int(11) NOT NULL,
PRIMARY KEY (`cluster_uuid`) PRIMARY KEY (`cluster_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SHOW CREATE TABLE mysql.wsrep_cluster_members; SHOW CREATE TABLE mysql.wsrep_cluster_members;
Table Create Table Table Create Table
wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` ( wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` (
...@@ -23,7 +23,7 @@ wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` ( ...@@ -23,7 +23,7 @@ wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` (
`node_name` char(32) NOT NULL, `node_name` char(32) NOT NULL,
`node_incoming_address` varchar(256) NOT NULL, `node_incoming_address` varchar(256) NOT NULL,
PRIMARY KEY (`node_uuid`) PRIMARY KEY (`node_uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
SELECT @@sql_safe_updates; SELECT @@sql_safe_updates;
@@sql_safe_updates @@sql_safe_updates
1 1
......
/* Copyright (C) 2015-2019 Codership Oy <info@codership.com> /* Copyright (C) 2015-2021 Codership Oy <info@codership.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -54,7 +54,7 @@ static const std::string create_cluster_table_str= ...@@ -54,7 +54,7 @@ static const std::string create_cluster_table_str=
"view_seqno BIGINT NOT NULL," "view_seqno BIGINT NOT NULL,"
"protocol_version INT NOT NULL," "protocol_version INT NOT NULL,"
"capabilities INT NOT NULL" "capabilities INT NOT NULL"
") ENGINE=InnoDB"; ") ENGINE=InnoDB STATS_PERSISTENT=0";
static const std::string create_members_table_str= static const std::string create_members_table_str=
"CREATE TABLE IF NOT EXISTS " + wsrep_schema_str + "." + members_table_str + "CREATE TABLE IF NOT EXISTS " + wsrep_schema_str + "." + members_table_str +
...@@ -63,7 +63,7 @@ static const std::string create_members_table_str= ...@@ -63,7 +63,7 @@ static const std::string create_members_table_str=
"cluster_uuid CHAR(36) NOT NULL," "cluster_uuid CHAR(36) NOT NULL,"
"node_name CHAR(32) NOT NULL," "node_name CHAR(32) NOT NULL,"
"node_incoming_address VARCHAR(256) NOT NULL" "node_incoming_address VARCHAR(256) NOT NULL"
") ENGINE=InnoDB"; ") ENGINE=InnoDB STATS_PERSISTENT=0";
#ifdef WSREP_SCHEMA_MEMBERS_HISTORY #ifdef WSREP_SCHEMA_MEMBERS_HISTORY
static const std::string cluster_member_history_table_str= "wsrep_cluster_member_history"; static const std::string cluster_member_history_table_str= "wsrep_cluster_member_history";
...@@ -76,7 +76,7 @@ static const std::string create_members_history_table_str= ...@@ -76,7 +76,7 @@ static const std::string create_members_history_table_str=
"last_view_seqno BIGINT NOT NULL," "last_view_seqno BIGINT NOT NULL,"
"node_name CHAR(32) NOT NULL," "node_name CHAR(32) NOT NULL,"
"node_incoming_address VARCHAR(256) NOT NULL" "node_incoming_address VARCHAR(256) NOT NULL"
") ENGINE=InnoDB"; ") ENGINE=InnoDB STATS_PERSISTENT=0";
#endif /* WSREP_SCHEMA_MEMBERS_HISTORY */ #endif /* WSREP_SCHEMA_MEMBERS_HISTORY */
static const std::string create_frag_table_str= static const std::string create_frag_table_str=
...@@ -88,7 +88,7 @@ static const std::string create_frag_table_str= ...@@ -88,7 +88,7 @@ static const std::string create_frag_table_str=
"flags INT NOT NULL, " "flags INT NOT NULL, "
"frag LONGBLOB NOT NULL, " "frag LONGBLOB NOT NULL, "
"PRIMARY KEY (node_uuid, trx_id, seqno)" "PRIMARY KEY (node_uuid, trx_id, seqno)"
") ENGINE=InnoDB"; ") ENGINE=InnoDB STATS_PERSISTENT=0";
static const std::string delete_from_cluster_table= static const std::string delete_from_cluster_table=
"DELETE FROM " + wsrep_schema_str + "." + cluster_table_str; "DELETE FROM " + wsrep_schema_str + "." + cluster_table_str;
...@@ -96,6 +96,26 @@ static const std::string delete_from_cluster_table= ...@@ -96,6 +96,26 @@ static const std::string delete_from_cluster_table=
static const std::string delete_from_members_table= static const std::string delete_from_members_table=
"DELETE FROM " + wsrep_schema_str + "." + members_table_str; "DELETE FROM " + wsrep_schema_str + "." + members_table_str;
/* For rolling upgrade we need to use ALTER. We do not want
persistent statistics to be collected from these tables. */
static const std::string alter_cluster_table=
"ALTER TABLE " + wsrep_schema_str + "." + cluster_table_str +
" STATS_PERSISTENT=0";
static const std::string alter_members_table=
"ALTER TABLE " + wsrep_schema_str + "." + members_table_str +
" STATS_PERSISTENT=0";
#ifdef WSREP_SCHEMA_MEMBERS_HISTORY
static const std::string alter_members_history_table=
"ALTER TABLE " + wsrep_schema_str + "." + members_history_table_str +
" STATS_PERSISTENT=0";
#endif
static const std::string alter_frag_table=
"ALTER TABLE " + wsrep_schema_str + "." + sr_table_str +
" STATS_PERSISTENT=0";
namespace Wsrep_schema_impl namespace Wsrep_schema_impl
{ {
...@@ -657,13 +677,27 @@ int Wsrep_schema::init() ...@@ -657,13 +677,27 @@ int Wsrep_schema::init()
Wsrep_schema_impl::execute_SQL(thd, Wsrep_schema_impl::execute_SQL(thd,
create_members_history_table_str.c_str(), create_members_history_table_str.c_str(),
create_members_history_table_str.size()) || create_members_history_table_str.size()) ||
Wsrep_schema_impl::execute_SQL(thd,
alter_members_history_table.c_str(),
alter_members_history_table.size()) ||
#endif /* WSREP_SCHEMA_MEMBERS_HISTORY */ #endif /* WSREP_SCHEMA_MEMBERS_HISTORY */
Wsrep_schema_impl::execute_SQL(thd, Wsrep_schema_impl::execute_SQL(thd,
create_frag_table_str.c_str(), create_frag_table_str.c_str(),
create_frag_table_str.size())) { create_frag_table_str.size()) ||
Wsrep_schema_impl::execute_SQL(thd,
alter_cluster_table.c_str(),
alter_cluster_table.size()) ||
Wsrep_schema_impl::execute_SQL(thd,
alter_members_table.c_str(),
alter_members_table.size()) ||
Wsrep_schema_impl::execute_SQL(thd,
alter_frag_table.c_str(),
alter_frag_table.size()))
{
ret= 1; ret= 1;
} }
else { else
{
ret= 0; ret= 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment