summaryrefslogtreecommitdiff
path: root/sql/wsrep_schema.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-24 08:42:23 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-24 08:42:23 +0300
commit7e2b42324caf6faaaa5a3a033c2b24e1fee93669 (patch)
tree282e59399ddb9e3f72f2607deb163e580f06a88f /sql/wsrep_schema.cc
parentf5794e1dc6e3d27405daeae850b8e69fd631b62d (diff)
parent913efaa328026455cef0e608c25eaed042344b15 (diff)
downloadmariadb-git-7e2b42324caf6faaaa5a3a033c2b24e1fee93669.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql/wsrep_schema.cc')
-rw-r--r--sql/wsrep_schema.cc48
1 files changed, 41 insertions, 7 deletions
diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc
index 0df1b527afe..252f41cb380 100644
--- a/sql/wsrep_schema.cc
+++ b/sql/wsrep_schema.cc
@@ -1,4 +1,4 @@
-/* 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
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=
"view_seqno BIGINT NOT NULL,"
"protocol_version INT NOT NULL,"
"capabilities INT NOT NULL"
- ") ENGINE=InnoDB";
+ ") ENGINE=InnoDB STATS_PERSISTENT=0";
static const std::string create_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=
"cluster_uuid CHAR(36) NOT NULL,"
"node_name CHAR(32) NOT NULL,"
"node_incoming_address VARCHAR(256) NOT NULL"
- ") ENGINE=InnoDB";
+ ") ENGINE=InnoDB STATS_PERSISTENT=0";
#ifdef WSREP_SCHEMA_MEMBERS_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=
"last_view_seqno BIGINT NOT NULL,"
"node_name CHAR(32) NOT NULL,"
"node_incoming_address VARCHAR(256) NOT NULL"
- ") ENGINE=InnoDB";
+ ") ENGINE=InnoDB STATS_PERSISTENT=0";
#endif /* WSREP_SCHEMA_MEMBERS_HISTORY */
static const std::string create_frag_table_str=
@@ -88,7 +88,7 @@ static const std::string create_frag_table_str=
"flags INT NOT NULL, "
"frag LONGBLOB NOT NULL, "
"PRIMARY KEY (node_uuid, trx_id, seqno)"
- ") ENGINE=InnoDB";
+ ") ENGINE=InnoDB STATS_PERSISTENT=0";
static const std::string delete_from_cluster_table=
"DELETE FROM " + wsrep_schema_str + "." + cluster_table_str;
@@ -96,6 +96,26 @@ static const std::string delete_from_cluster_table=
static const std::string delete_from_members_table=
"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
{
@@ -675,13 +695,27 @@ int Wsrep_schema::init()
Wsrep_schema_impl::execute_SQL(thd,
create_members_history_table_str.c_str(),
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 */
Wsrep_schema_impl::execute_SQL(thd,
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;
}
- else {
+ else
+ {
ret= 0;
}