This repository was archived by the owner on May 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bugfix issue240 (#241) * Preliminary fix for issue #240 * Disable header check for TestConf as it must not affect overall usage the tool * Added check for [TestConf] header as well * Finalizing the issue fix * Adding --lock-ddl-per-table and --lock-ddl support (#244) * Preliminary fix for issue #243 * Calling for first test * Added some logging message * Redirecting the output to /dev/null * Adding x permission * Running the new sql commands * Trying to run this ddl_test.sh bash script * Using full string * making some changes * fixing redirect issue * unpexteced toke done * Changed workflow * Added u+x * calling it without bash command * fixing bash caller * fixing the path name * calling with /usr/bin/bash * Removed sleep statement * getting output from sqls * trying to fix issue again * trying to make cleanup actions * changing the try/except block position * chenged workflow again * Disabling sysbench run * Disabled this feature * Bugfix issue246 (#247) * Preliminary fix for issue #246 * Added options to config generator for --test_mode * Fixing directory naming * implicit conversion * Calling shutil.copytree here * Adding '_archive' string * copying backup_dir * Finalizing the feature implementation * Bugfix issue245 (#249) * Preliminary fix for issue #245 * Executing loop in concurrent.futures * Changing static method to use Popen * Reducing worker count * Increasing worker max count to 5000 * Changed back the value to 1000 * Reducing max worker count to 100 * Calling from ordinary loop * Implemented, finalizing the feature * Bugfix issue250 (#251) * Preliminary fix for issue #250 * Added rename basedirs bats file * Preliminary fix for issue #252 (#253) * Preliminary fix for issue #254 (#255) * Bugfix issue260 (#261) * Checking if archive is directory or not * Giving the full path * Bugfix issue264 (#265) * Preliminary fix for issue #264 * Decrypting some tables to be altered to unencrypted general tablespace file * Disabled converting tables to myisam * Bugfix issue262 (#266) * Preliminary fix for issue #262 * Unexpected argument error * Preliminary fix for issue #263 (#267) * Bugfix issue268 (#270) * Added 2 temporary table creation for issue #268 * Fixing typo * Added some bash files and removed previous calls * Calling the staticmethod * Fixing the table name * Fixing the sql * Added file permissions * Added create index run for creating temporary tables * Fixing the database name * again fix for database name * Disabled sleep query runs also added some kill process calls * Bugfix issue271 (#273) * Preliminary fix for issue #271: Added several optional bash files to be executed. Called it from take_backup.py * Removing drop statement * Added kill statements * VERSION BUMP * Bugfix issue275 (#276) * Parsing config properly. Added keyring_vault cmd option to pass. For issue #275 * Fixing the .sql extension files to be in package_data * changed a bit flow * Enabling back the general tablespace encryption * UnboundLocalError: local variable 'pid' referenced before assignment * Redirecting the output
- Loading branch information
Shahriyar Rzayev
authored
Apr 24, 2018
1 parent
06aecbb
commit 8ae7927
Showing
20 changed files
with
501 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ def print_version(ctx, param, value): | |
click.echo("Email: [email protected]") | ||
click.echo( | ||
"Based on Percona XtraBackup: https://github.com/percona/percona-xtrabackup/") | ||
click.echo('MySQL-AutoXtraBackup Version: 1.5.1') | ||
click.echo('MySQL-AutoXtraBackup Version: 1.5.2') | ||
ctx.exit() | ||
|
||
|
||
|
@@ -54,7 +54,7 @@ def check_file_content(file): | |
with open(file, 'r') as config_file: | ||
file_content = config_file.read() | ||
|
||
config_headers = ["MySQL", "Backup", "Encrypt", "Compress", "Commands", "TestConf"] | ||
config_headers = ["MySQL", "Backup", "Encrypt", "Compress", "Commands"] | ||
config_keys = [ | ||
"mysql", | ||
"mycnf", | ||
|
@@ -146,9 +146,28 @@ def validate_file(file): | |
'ERROR', | ||
'CRITICAL']), | ||
help="Set log level") | ||
@click.option('--log_file_max_bytes', | ||
default=1073741824, | ||
show_default=True, | ||
nargs=1, | ||
type=int, | ||
help="Set log file max size in bytes") | ||
@click.option('--log_file_backup_count', | ||
default=7, | ||
show_default=True, | ||
nargs=1, | ||
type=int, | ||
help="Set log file backup count") | ||
@click.option('--keyring_vault', | ||
default=0, | ||
show_default=True, | ||
nargs=1, | ||
type=int, | ||
help="Enable this when you pass keyring_vault options in default mysqld options in config" | ||
"[Only for using with --test_mode]") | ||
@click.option('--test_mode', | ||
is_flag=True, | ||
help="Enable test mode.Must be used with --defaults_file and only for TESTs for XtraBackup") | ||
help="Enable test mode. Must be used with --defaults_file and only for TESTs for XtraBackup") | ||
@click.option('--help', | ||
is_flag=True, | ||
callback=print_help, | ||
|
@@ -157,7 +176,9 @@ def validate_file(file): | |
help="Print help message and exit.") | ||
@click.pass_context | ||
def all_procedure(ctx, prepare, backup, partial, tag, show_tags, | ||
verbose, log_file, log, defaults_file, dry_run, test_mode): | ||
verbose, log_file, log, defaults_file, | ||
dry_run, test_mode, log_file_max_bytes, | ||
log_file_backup_count, keyring_vault): | ||
logger.setLevel(log) | ||
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s', | ||
datefmt='%Y-%m-%d %H:%M:%S') | ||
|
@@ -169,7 +190,8 @@ def all_procedure(ctx, prepare, backup, partial, tag, show_tags, | |
|
||
if log_file: | ||
try: | ||
file_handler = RotatingFileHandler(log_file, mode='a', maxBytes=104857600, backupCount=7) | ||
file_handler = RotatingFileHandler(log_file, mode='a', | ||
maxBytes=log_file_max_bytes, backupCount=log_file_backup_count) | ||
file_handler.setFormatter(formatter) | ||
logger.addHandler(file_handler) | ||
except PermissionError as err: | ||
|
@@ -200,7 +222,10 @@ def all_procedure(ctx, prepare, backup, partial, tag, show_tags, | |
test_obj = RunnerTestMode(config=defaults_file) | ||
for basedir in test_obj.basedirs: | ||
if ('5.7' in basedir) and ('2_4_ps_5_7' in defaults_file): | ||
test_obj.wipe_backup_prepare_copyback(basedir=basedir) | ||
if keyring_vault == 1: | ||
test_obj.wipe_backup_prepare_copyback(basedir=basedir, keyring_vault=1) | ||
else: | ||
test_obj.wipe_backup_prepare_copyback(basedir=basedir) | ||
elif ('5.6' in basedir) and ('2_4_ps_5_6' in defaults_file): | ||
test_obj.wipe_backup_prepare_copyback(basedir=basedir) | ||
elif ('5.6' in basedir) and ('2_3_ps_5_6' in defaults_file): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
PATH=$1 | ||
BASEDIR=$2 | ||
MYSQL_SOCK=$3 | ||
|
||
while true; do /usr/bin/bash ${PATH}/create_index_temp.sh ${BASEDIR} ${MYSQL_SOCK}; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
PATH=$1 | ||
BASEDIR=$2 | ||
MYSQL_SOCK=$3 | ||
|
||
while true; do /usr/bin/bash ${PATH}/ddl_test.sh ${BASEDIR} ${MYSQL_SOCK}; done |
11 changes: 11 additions & 0 deletions
11
prepare_env_test_mode/call_innodb_online_alter_encryption_alters.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This bash file is for creating necessary environment for running tests | ||
# See https://jira.percona.com/browse/PS-3819 | ||
|
||
BASEDIR=$1 | ||
MYSQL_SOCK=$2 | ||
FILE_DIR=$3 | ||
MYSQL_USER=root | ||
|
||
while true; do ${BASEDIR}/bin/mysql --user=${MYSQL_USER} --socket=${MYSQL_SOCK} < ${FILE_DIR}/innodb_online_alter_encryption_alters.sql >> /dev/null 2>&1; done |
11 changes: 11 additions & 0 deletions
11
prepare_env_test_mode/call_innodb_online_alter_encryption_sql.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This bash file is for creating necessary environment for running tests | ||
# See https://jira.percona.com/browse/PS-3819 | ||
|
||
BASEDIR=$1 | ||
MYSQL_SOCK=$2 | ||
FILE_DIR=$3 | ||
MYSQL_USER=root | ||
|
||
${BASEDIR}/bin/mysql --user=${MYSQL_USER} --socket=${MYSQL_SOCK} < ${FILE_DIR}/innodb_online_alter_encryption.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
PATH=$1 | ||
BASEDIR=$2 | ||
MYSQL_SOCK=$3 | ||
|
||
while true; do /usr/bin/bash ${PATH}/temp_table_test.sh ${BASEDIR} ${MYSQL_SOCK}; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
BASEDIR=$1 | ||
MYSQL_SOCK=$2 | ||
MYSQL_USER=root | ||
#CONN_STR=${BASEDIR}/bin/mysql --user=${MYSQL_USER} --socket=${MYSQL_SOCK} | ||
|
||
|
||
${BASEDIR}/bin/mysql --user=${MYSQL_USER} --socket=${MYSQL_SOCK} -e "CREATE INDEX t10_b ON sysbench_test_db.t10 (b)" | ||
${BASEDIR}/bin/mysql --user=${MYSQL_USER} --socket=${MYSQL_SOCK} -e "DROP INDEX t10_b ON sysbench_test_db.t10" | ||
|
||
${BASEDIR}/bin/mysql --user=${MYSQL_USER} --socket=${MYSQL_SOCK} -e "CREATE INDEX t10_b ON sysbench_test_db.t10 (b) ALGORITHM=COPY" | ||
${BASEDIR}/bin/mysql --user=${MYSQL_USER} --socket=${MYSQL_SOCK} -e "DROP INDEX t10_b ON sysbench_test_db.t10 ALGORITHM=COPY" |
Oops, something went wrong.