Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert tables in mod_logger, mod_hpcdb, and mod_shredder to InnoDB #1576

Merged
merged 5 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions configuration/etl/etl.d/xdmod-migration-9_5_0-10_0_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,57 @@
"schema": "modw"
}
}
},
{
"name": "update-schema-version-history-tables-to-innodb",
"description": "Update modw_cloud tables to InnoDB",
"class": "ManageTables",
"definition_file_list": [
"common/hpcdb/schema-version-history.json"
],
"endpoints": {
"destination": {
"type": "mysql",
"name": "XDMoD Data Warehouse",
"config": "datawarehouse",
"schema": "mod_hpcdb"
}
}
},
{
"name": "update-shredder-tables-to-innodb",
"description": "Update modw_cloud tables to InnoDB",
"class": "ManageTables",
"definition_file_list": [
"common/shredder/schema-version-history.json"
],
"endpoints": {
"destination": {
"type": "mysql",
"name": "XDMoD Data Warehouse",
"config": "datawarehouse",
"schema": "mod_shredder"
}
}
},
{
"name": "convert-mod-logger-tables-to-innodb",
"description": "Convert mod_logger tables to InnoDB",
"class": "ExecuteSql",
"sql_file_list": [
{
"delimiter": ";",
"sql_file": "migrations/9.5.0-10.0.0/mod_logger/convert_to_innodb.sql"
}
],
"endpoints": {
"destination": {
"type": "mysql",
"name": "XDMoD Data Warehouse",
"config": "datawarehouse",
"schema": "mod_logger"
}
}
}
],
"cloud-migration-9-5-0_10-0-0": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- These tables cannot be locked for writing while converting to InnoDB as it
-- will cause a deadlock and the migration process will time out.

ALTER TABLE `mod_logger`.`log_id_seq` ENGINE=InnoDB;
ALTER TABLE `mod_logger`.`log_level` ENGINE=InnoDB;
ALTER TABLE `mod_logger`.`log_table` ENGINE=InnoDB;
ALTER TABLE `mod_logger`.`schema_version_history` ENGINE=InnoDB;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"table_definition": {
"name": "schema_version_history",
"engine": "MyISAM",
"engine": "InnoDB",
"columns": [
{
"name": "database_name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"table_definition": {
"name": "schema_version_history",
"engine": "MyISAM",
"engine": "InnoDB",
"columns": [
{
"name": "database_name",
Expand Down
9 changes: 4 additions & 5 deletions db/schema/mod_logger.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DROP TABLE IF EXISTS `log_id_seq`;
CREATE TABLE `log_id_seq` (
`sequence` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`sequence`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `log_level`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
Expand All @@ -25,7 +25,7 @@ CREATE TABLE `log_level` (
`level` varchar(16) NOT NULL,
`description` varchar(64) DEFAULT NULL,
PRIMARY KEY (`log_level_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `log_table`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
Expand All @@ -41,7 +41,7 @@ CREATE TABLE `log_table` (
KEY `priority_idx` (`priority`),
KEY `logscan` (`ident`,`priority`,`id`),
KEY `get_messages_idx` (`ident`,`logtime`,`priority`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `schema_version_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
Expand All @@ -53,7 +53,7 @@ CREATE TABLE `schema_version_history` (
`action_type` enum('created','upgraded') NOT NULL,
`script_name` varchar(255) NOT NULL,
PRIMARY KEY (`database_name`,`schema_version`,`action_datetime`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

Expand All @@ -64,4 +64,3 @@ CREATE TABLE `schema_version_history` (
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;