Skip to content

Commit

Permalink
Merge pull request #1576 from eiffel777/convert-misc-tables-to-innodb
Browse files Browse the repository at this point in the history
Convert tables in mod_logger, mod_hpcdb, and mod_shredder to InnoDB
  • Loading branch information
eiffel777 authored Dec 3, 2021
2 parents f42114f + 29788bf commit ee40255
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 7 deletions.
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 */;

0 comments on commit ee40255

Please sign in to comment.