Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit bc64aaba916590eae0479f9cfd55db7d1889fe2d
- Author: Garrett <garrett@dbm1.db.aws.awebsitesomewhere.com>
- Date: Fri Feb 12 17:31:01 2016 -0500
- Implement log-bin option for xtrabackup, grumble grumble
- diff --git a/storage/innobase/xtrabackup/src/backup_mysql.cc b/storage/innobase/xtrabackup/src/backup_mysql.cc
- index 39d7425..ee9eabb 100644
- --- a/storage/innobase/xtrabackup/src/backup_mysql.cc
- +++ b/storage/innobase/xtrabackup/src/backup_mysql.cc
- @@ -1178,6 +1178,11 @@ write_current_binlog_file(MYSQL *connection)
- read_mysql_variables(connection, "SHOW MASTER STATUS",
- status_after_flush, false);
- + if (opt_bin_logname != NULL)
- + {
- + log_bin_dir = strdup(opt_bin_logname);
- + }
- +
- if (log_bin_dir == NULL) {
- /* log_bin_basename does not exist in MariaDB,
- fallback to datadir */
- diff --git a/storage/innobase/xtrabackup/src/innobackupex.cc b/storage/innobase/xtrabackup/src/innobackupex.cc
- index bba6305..88edc2e 100644
- --- a/storage/innobase/xtrabackup/src/innobackupex.cc
- +++ b/storage/innobase/xtrabackup/src/innobackupex.cc
- @@ -131,6 +131,7 @@ ulonglong ibx_xtrabackup_compress_chunk_size;
- ulong ibx_xtrabackup_encrypt_algo;
- char *ibx_xtrabackup_encrypt_key;
- char *ibx_xtrabackup_encrypt_key_file;
- +char *ibx_xtrabackup_log_bin;
- uint ibx_xtrabackup_encrypt_threads;
- ulonglong ibx_xtrabackup_encrypt_chunk_size;
- my_bool ibx_xtrabackup_export;
- @@ -221,6 +222,7 @@ enum innobackupex_options
- OPT_ENCRYPT,
- OPT_ENCRYPT_KEY,
- OPT_ENCRYPT_KEY_FILE,
- + OPT_LOG_BIN,
- OPT_ENCRYPT_THREADS,
- OPT_ENCRYPT_CHUNK_SIZE,
- OPT_EXPORT,
- @@ -591,6 +593,11 @@ static struct my_option ibx_long_options[] =
- (uchar*) &ibx_xtrabackup_encrypt_key_file, 0,
- GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- + {"log-bin", OPT_LOG_BIN, "This option tells xtrabackup where to find the binary log directory because Percona, MySQL, and MariaDB are shit.",
- + (uchar*) &ibx_xtrabackup_log_bin,
- + (uchar*) &ibx_xtrabackup_log_bin, 0,
- + GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- +
- {"encrypt-threads", OPT_ENCRYPT_THREADS,
- "This option specifies the number of worker threads that will be used "
- "for parallel encryption. It is passed directly to the xtrabackup "
- @@ -761,6 +768,7 @@ SYNOPOSIS\n\
- innobackupex [--compress] [--compress-threads=NUMBER-OF-THREADS] [--compress-chunk-size=CHUNK-SIZE]\n\
- [--encrypt=ENCRYPTION-ALGORITHM] [--encrypt-threads=NUMBER-OF-THREADS] [--encrypt-chunk-size=CHUNK-SIZE]\n\
- [--encrypt-key=LITERAL-ENCRYPTION-KEY] | [--encryption-key-file=MY.KEY]\n\
- + [--log-bin=/path/to/bin]\n\
- [--include=REGEXP] [--user=NAME]\n\
- [--password=WORD] [--port=PORT] [--socket=SOCKET]\n\
- [--no-timestamp] [--ibbackup=IBBACKUP-BINARY]\n\
- @@ -1039,6 +1047,7 @@ ibx_init()
- xtrabackup_encrypt_algo = ibx_xtrabackup_encrypt_algo;
- xtrabackup_encrypt_key = ibx_xtrabackup_encrypt_key;
- xtrabackup_encrypt_key_file = ibx_xtrabackup_encrypt_key_file;
- + opt_bin_logname = ibx_xtrabackup_log_bin;
- xtrabackup_encrypt_threads = ibx_xtrabackup_encrypt_threads;
- xtrabackup_encrypt_chunk_size = ibx_xtrabackup_encrypt_chunk_size;
- xtrabackup_export = ibx_xtrabackup_export;
- diff --git a/storage/innobase/xtrabackup/src/xtrabackup.cc b/storage/innobase/xtrabackup/src/xtrabackup.cc
- index 559a8d2..b44bedb 100644
- --- a/storage/innobase/xtrabackup/src/xtrabackup.cc
- +++ b/storage/innobase/xtrabackup/src/xtrabackup.cc
- @@ -358,6 +358,7 @@ char *opt_incremental_history_uuid = NULL;
- char *opt_user = NULL;
- char *opt_password = NULL;
- +char *opt_logbin = NULL;
- char *opt_host = NULL;
- char *opt_defaults_group = NULL;
- char *opt_socket = NULL;
- @@ -579,6 +580,7 @@ enum options_xtrabackup
- OPT_HOST,
- OPT_PORT,
- OPT_PASSWORD,
- + OPT_LOGBIN,
- OPT_SOCKET,
- OPT_INCREMENTAL_HISTORY_NAME,
- OPT_INCREMENTAL_HISTORY_UUID,
- @@ -1077,6 +1079,10 @@ Disable with --skip-innodb-doublewrite.", (G_PTR*) &innobase_use_doublewrite,
- (uchar*) &opt_password, (uchar*) &opt_password, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- + {"log-bin", OPT_LOGBIN, "This option specifies the path to binary logs, because suck it Percona and MariaDB and Oracle",
- + (uchar*) &opt_logbin, (uchar*) &opt_logbin, 0, GET_STR,
- + REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- +
- {"socket", OPT_SOCKET, "This option specifies the socket to use when "
- "connecting to the local database server with a UNIX domain socket. "
- "The option accepts a string argument. See mysql --help for details.",
- diff --git a/storage/innobase/xtrabackup/src/xtrabackup.h b/storage/innobase/xtrabackup/src/xtrabackup.h
- index 7a7f1cb..f2d633a 100644
- --- a/storage/innobase/xtrabackup/src/xtrabackup.h
- +++ b/storage/innobase/xtrabackup/src/xtrabackup.h
- @@ -142,6 +142,7 @@ extern char *opt_incremental_history_uuid;
- extern char *opt_user;
- extern char *opt_password;
- +extern char *opt_logbin;
- extern char *opt_host;
- extern char *opt_defaults_group;
- extern char *opt_socket;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement