Commit 1e36da22 authored by Andy Yates's avatar Andy Yates
Browse files

[ENSCORESW-576]. Prevent optimisation of DBs when copying from staging.

The production and web teams have reported odd going ons when people copy from
staging onto another server. This is because this script optimises databases
before copying. These DBs should already be optimised so there is no need
to do this stage. In fact it can alter the checksums of the MYI files which
causes the webteam to wonder if data has been switched out without them knowing.
parent 0104cd56
......@@ -77,6 +77,11 @@ Command line switches:
index data onto disk. This may be a time consuming
operation for very large tables. The --noopt flag
disables the optimization.
DO NOT RUN OPTIMIZE WHEN YOU ARE ON THE STAGING
MACHINES. THESE ARE OPTIMIZED BY THE PRODUCTION
TEAM DURING THE RELEASE CYCLE. ATTEMPTING TO DO
THIS WILL CAUSE THE SCRIPT TO DIE.
--notargetflush (Optional)
Skips table flushing on the target machine.
......@@ -432,6 +437,12 @@ while ( my $line = $in->getline() ) {
$failed = 1;
}
if(! $failed && $source_server =~ /^ens-staging\d+$/ && $opt_optimize) {
my $tmpl = q{line %d: Source server '%s' is an ens-staging machine. Do not optimize on this server. Rerun with -noopt};
warn(sprintf($tmpl, $lineno, $source_server));
$failed = 1;
}
if ( !$failed ) {
push( @todo, {
'source_server' => $source_server,
......
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