From c9f3769cd3483c091429862e083b55e9c3d41e47 Mon Sep 17 00:00:00 2001 From: Seth Reeser Date: Sun, 27 Aug 2023 15:20:11 -0400 Subject: [PATCH] RedHat: Disable table locking for MyISAM tables during mysqldump. --- VERSION.yml | 2 +- provisioners/redhat/modules/mysql_database_backup.sh | 2 +- provisioners/redhat/modules/mysql_database_table_retain.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.yml b/VERSION.yml index 73fb2de3..b04e2d85 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,5 +1,5 @@ --- -version: 4.7.0 +version: 4.7.1 major: description: "Catapult uses Semantic Versioning. During a MAJOR increment, incompatable API changes are made which require a manual upgrade path. Please follow these directions:" notice: "NEW MAJOR VERSION OF CATAPULT AVAILABLE" diff --git a/provisioners/redhat/modules/mysql_database_backup.sh b/provisioners/redhat/modules/mysql_database_backup.sh index 519e3cb1..a79cda81 100644 --- a/provisioners/redhat/modules/mysql_database_backup.sh +++ b/provisioners/redhat/modules/mysql_database_backup.sh @@ -23,7 +23,7 @@ if ([ ! -z "${software}" ]); then # create the _sql directory if it does not exist mkdir --parents "/var/www/repositories/apache/${domain}/_sql" # dump the database - mysqldump --defaults-extra-file=$dbconf --single-transaction --quick ${1}_${domain_valid_db_name} > /var/www/repositories/apache/${domain}/_sql/$(date +"%Y%m%d").sql + mysqldump --defaults-extra-file=$dbconf --lock-tables=false --single-transaction --quick ${1}_${domain_valid_db_name} > /var/www/repositories/apache/${domain}/_sql/$(date +"%Y%m%d").sql # write out a sql lock file for use in controlling what is restored in other environments touch "/var/www/repositories/apache/${domain}/_sql/$(date +"%Y%m%d").sql.lock" # ensure no more than 250mb or at least the one, newest, YYYYMMDD.sql file exists diff --git a/provisioners/redhat/modules/mysql_database_table_retain.sh b/provisioners/redhat/modules/mysql_database_table_retain.sh index b411fd01..9d7f0a09 100644 --- a/provisioners/redhat/modules/mysql_database_table_retain.sh +++ b/provisioners/redhat/modules/mysql_database_table_retain.sh @@ -27,7 +27,7 @@ if ([ ! -z "${software}" ]); then mkdir --parents "/var/www/repositories/apache/${domain}/_sql" # dump the database tables that are specified # note if there is an invalid table, there will be an error of: mysqldump: Couldn't find table: "test" - mysqldump --defaults-extra-file=$dbconf --single-transaction --quick ${1}_${domain_valid_db_name} ${software_dbtable_retain[*]} > /var/www/repositories/apache/${domain}/_sql/$(date +"%Y%m%d")_software_dbtable_retain.sql + mysqldump --defaults-extra-file=$dbconf --lock-tables=false --single-transaction --quick ${1}_${domain_valid_db_name} ${software_dbtable_retain[*]} > /var/www/repositories/apache/${domain}/_sql/$(date +"%Y%m%d")_software_dbtable_retain.sql # write out a sql lock file for use in controlling what is restored in other environments touch "/var/www/repositories/apache/${domain}/_sql/$(date +"%Y%m%d")_software_dbtable_retain.sql.lock" # ensure no more than 50mb or at least the one, newest, YYYYMMDD_software_dbtable_retain.sql file exists