| 1 |
/****************************************************** |
| 2 |
hot backup tool for InnoDB |
| 3 |
(c) 2009-2015 Percona LLC and/or its affiliates |
| 4 |
Originally Created 3/3/2009 Yasufumi Kinoshita |
| 5 |
Written by Alexey Kopytov, Aleksandr Kuzminsky, Stewart Smith, Vadim Tkachenko, |
| 6 |
Yasufumi Kinoshita, Ignacio Nin and Baron Schwartz. |
| 7 |
|
| 8 |
This program is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; version 2 of the License. |
| 11 |
|
| 12 |
This program is distributed in the hope that it will be useful, |
| 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
GNU General Public License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU General Public License |
| 18 |
along with this program; if not, write to the Free Software |
| 19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA |
| 20 |
|
| 21 |
******************************************************* |
| 22 |
|
| 23 |
This file incorporates work covered by the following copyright and |
| 24 |
permission notice: |
| 25 |
|
| 26 |
Copyright (c) 2000, 2011, MySQL AB & Innobase Oy. All Rights Reserved. |
| 27 |
|
| 28 |
This program is free software; you can redistribute it and/or modify it under |
| 29 |
the terms of the GNU General Public License as published by the Free Software |
| 30 |
Foundation; version 2 of the License. |
| 31 |
|
| 32 |
This program is distributed in the hope that it will be useful, but WITHOUT |
| 33 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 34 |
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 35 |
|
| 36 |
You should have received a copy of the GNU General Public License along with |
| 37 |
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin |
| 38 |
Street, Fifth Floor, Boston, MA 02110-1335 USA |
| 39 |
|
| 40 |
*******************************************************/ |
| 41 |
|
| 42 |
#include <my_global.h>cxx . . $ `<file>/include/my_global.h`/ |
| 43 |
#include <stdio.h> |
| 44 |
#include <string.h> |
| 45 |
#include <mysql.h>cxx . . $ `<file>/include/mysql.h`/ |
| 46 |
#include <my_dir.h>cxx . . $ `<file>/include/my_dir.h`/ |
| 47 |
#include <os0file.h>cxx . . $ `<file>/storage/innobase/include/os0file.h`/ |
| 48 |
#include "buf0buf.h"cxx . . $ `<file>/storage/innobase/include/buf0buf.h`/ |
| 49 |
#include <srv0start.h>cxx . . $ `<file>/storage/innobase/include/srv0start.h`/ |
| 50 |
#include <algorithm> |
| 51 |
#include <mysqld.h>cxx . . $ `<file>/sql/mysqld.h`/ |
| 52 |
#include <my_default.h>cxx . . $ `<file>/include/my_default.h`/ |
| 53 |
#include <my_getopt.h>cxx . . $ `<file>/include/my_getopt.h`/ |
| 54 |
#include <string> |
| 55 |
#include <sstream> |
| 56 |
#include <set> |
| 57 |
#include "common.h"cxx . . $ `<file>/extra/mariabackup/common.h`/ |
| 58 |
#include "innobackupex.h"cxx . . $ `<file>/extra/mariabackup/innobackupex.h`/ |
| 59 |
#include "xtrabackup.h"cxx . . $ `<file>/extra/mariabackup/xtrabackup.h`/ |
| 60 |
#include "xbstream.h"cxx . . $ `<file>/extra/mariabackup/xbstream.h`/ |
| 61 |
#include "fil_cur.h"cxx . . $ `<file>/extra/mariabackup/fil_cur.h`/ |
| 62 |
#include "write_filt.h"cxx . . $ `<file>/extra/mariabackup/write_filt.h`/ |
| 63 |
#include "backup_copy.h"cxx . . $ `<file>/extra/mariabackup/backup_copy.h`/ |
| 64 |
|
| 65 |
using stdcxx . . $ std/::mincxx . . $ min(27ef22a5dfeda5c).; |
| 66 |
using stdcxx . . $ std/::maxcxx . . $ max(27ef22a5dfeda5c).; |
| 67 |
|
| 68 |
/* options */ |
| 69 |
my_boolcxx . . $ my_bool# opt_ibx_versioncxx . . $ opt_ibx_version. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 70 |
my_boolcxx . . $ my_bool# opt_ibx_helpcxx . . $ opt_ibx_help. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 71 |
my_boolcxx . . $ my_bool# opt_ibx_apply_logcxx . . $ opt_ibx_apply_log. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 72 |
my_boolcxx . . $ my_bool# opt_ibx_incrementalcxx . . $ opt_ibx_incremental. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 73 |
my_boolcxx . . $ my_bool# opt_ibx_notimestampcxx . . $ opt_ibx_notimestamp. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 74 |
|
| 75 |
my_boolcxx . . $ my_bool# opt_ibx_copy_backcxx . . $ opt_ibx_copy_back. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 76 |
my_boolcxx . . $ my_bool# opt_ibx_move_backcxx . . $ opt_ibx_move_back. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 77 |
my_boolcxx . . $ my_bool# opt_ibx_galera_infocxx . . $ opt_ibx_galera_info. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 78 |
my_boolcxx . . $ my_bool# opt_ibx_slave_infocxx . . $ opt_ibx_slave_info. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 79 |
my_boolcxx . . $ my_bool# opt_ibx_no_lockcxx . . $ opt_ibx_no_lock. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 80 |
my_boolcxx . . $ my_bool# opt_ibx_safe_slave_backupcxx . . $ opt_ibx_safe_slave_backup. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 81 |
my_boolcxx . . $ my_bool# opt_ibx_force_non_empty_dirscxx . . $ opt_ibx_force_non_empty_dirs. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 82 |
my_boolcxx . . $ my_bool# opt_ibx_noversioncheckcxx . . $ opt_ibx_noversioncheck. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 83 |
my_boolcxx . . $ my_bool# opt_ibx_decompresscxx . . $ opt_ibx_decompress. = FALSEcxx . . $ `include/my_global.h:477:9`!; |
| 84 |
|
| 85 |
char *opt_ibx_incremental_history_namecxx . . $ opt_ibx_incremental_history_name. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 86 |
char *opt_ibx_incremental_history_uuidcxx . . $ opt_ibx_incremental_history_uuid. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 87 |
|
| 88 |
char *opt_ibx_usercxx . . $ opt_ibx_user. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 89 |
const char *opt_ibx_passwordcxx . . $ opt_ibx_password. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 90 |
char *opt_ibx_hostcxx . . $ opt_ibx_host. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 91 |
char *opt_ibx_defaults_groupcxx . . $ opt_ibx_defaults_group. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 92 |
char *opt_ibx_socketcxx . . $ opt_ibx_socket. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 93 |
uint opt_ibx_portcxx . . $ opt_ibx_port. = 0; |
| 94 |
|
| 95 |
ulong opt_ibx_lock_wait_query_typecxx . . $ opt_ibx_lock_wait_query_type.; |
| 96 |
ulong opt_ibx_kill_long_query_typecxx . . $ opt_ibx_kill_long_query_type.; |
| 97 |
|
| 98 |
uint opt_ibx_kill_long_queries_timeoutcxx . . $ opt_ibx_kill_long_queries_timeout. = 0; |
| 99 |
uint opt_ibx_lock_wait_timeoutcxx . . $ opt_ibx_lock_wait_timeout. = 0; |
| 100 |
uint opt_ibx_lock_wait_thresholdcxx . . $ opt_ibx_lock_wait_threshold. = 0; |
| 101 |
uint opt_ibx_debug_sleep_before_unlockcxx . . $ opt_ibx_debug_sleep_before_unlock. = 0; |
| 102 |
uint opt_ibx_safe_slave_backup_timeoutcxx . . $ opt_ibx_safe_slave_backup_timeout. = 0; |
| 103 |
|
| 104 |
const char *opt_ibx_historycxx . . $ opt_ibx_history. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 105 |
|
| 106 |
char *opt_ibx_includecxx . . $ opt_ibx_include. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 107 |
char *opt_ibx_databasescxx . . $ opt_ibx_databases. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 108 |
bool ibx_partial_backupcxx . . $ ibx_partial_backup. = false; |
| 109 |
|
| 110 |
char *ibx_position_argcxx . . $ ibx_position_arg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 111 |
char *ibx_backup_directorycxx . . $ ibx_backup_directory. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 112 |
|
| 113 |
extern bool xb_opt_destroy_passwordcxx . . $ xb_opt_destroy_password.; |
| 114 |
|
| 115 |
/* copy of proxied xtrabackup options */ |
| 116 |
my_boolcxx . . $ my_bool# ibx_xb_close_filescxx . . $ ibx_xb_close_files.; |
| 117 |
const char *ibx_xtrabackup_compress_algcxx . . $ ibx_xtrabackup_compress_alg.; |
| 118 |
uint ibx_xtrabackup_compress_threadscxx . . $ ibx_xtrabackup_compress_threads.; |
| 119 |
ulonglongcxx . . $ ulonglong# ibx_xtrabackup_compress_chunk_sizecxx . . $ ibx_xtrabackup_compress_chunk_size.; |
| 120 |
my_boolcxx . . $ my_bool# ibx_xtrabackup_exportcxx . . $ ibx_xtrabackup_export.; |
| 121 |
char *ibx_xtrabackup_extra_lsndircxx . . $ ibx_xtrabackup_extra_lsndir.; |
| 122 |
char *ibx_xtrabackup_incremental_basedircxx . . $ ibx_xtrabackup_incremental_basedir.; |
| 123 |
char *ibx_xtrabackup_incremental_dircxx . . $ ibx_xtrabackup_incremental_dir.; |
| 124 |
my_boolcxx . . $ my_bool# ibx_xtrabackup_incremental_force_scancxx . . $ ibx_xtrabackup_incremental_force_scan.; |
| 125 |
ulintcxx . . $ ulint# ibx_xtrabackup_log_copy_intervalcxx . . $ ibx_xtrabackup_log_copy_interval.; |
| 126 |
char *ibx_xtrabackup_incrementalcxx . . $ ibx_xtrabackup_incremental.; |
| 127 |
int ibx_xtrabackup_parallelcxx . . $ ibx_xtrabackup_parallel.; |
| 128 |
char *ibx_xtrabackup_stream_strcxx . . $ ibx_xtrabackup_stream_str.; |
| 129 |
char *ibx_xtrabackup_tables_filecxx . . $ ibx_xtrabackup_tables_file.; |
| 130 |
long ibx_xtrabackup_throttlecxx . . $ ibx_xtrabackup_throttle.; |
| 131 |
char *ibx_opt_mysql_tmpdircxx . . $ ibx_opt_mysql_tmpdir.; |
| 132 |
longlongcxx . . $ longlong# ibx_xtrabackup_use_memorycxx . . $ ibx_xtrabackup_use_memory.; |
| 133 |
|
| 134 |
|
| 135 |
static inline int ibx_msgcxx . . $ ibx_msg(581fddd72a8db8fc).(const char *fmt, ...) ATTRIBUTE_FORMATcxx . . $ `include/my_attribute.h:57:10`!(printf, 1, 2); |
| 136 |
static inline int ibx_msgcxx . . $ ibx_msg(581fddd72a8db8fc).(const char *fmt, ...) |
| 137 |
{ |
| 138 |
int result; |
| 139 |
time_tcxx . . $ time_t# t = time(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 140 |
char date[100]; |
| 141 |
char *line; |
| 142 |
va_list args; |
| 143 |
|
| 144 |
strftime(date, sizeof(date), "%y%m%d %H:%M:%S", localtime(&t)); |
| 145 |
|
| 146 |
va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, fmt); |
| 147 |
|
| 148 |
result = vasprintf(&line, fmt, args); |
| 149 |
|
| 150 |
va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); |
| 151 |
|
| 152 |
if (result != -1) { |
| 153 |
result = fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s %s: %s", |
| 154 |
date, INNOBACKUPEX_BIN_NAMEcxx . . $ `extra/mariabackup/innobackupex.h:24:9`!, line); |
| 155 |
free(line); |
| 156 |
} |
| 157 |
|
| 158 |
return result; |
| 159 |
} |
| 160 |
|
| 161 |
enum innobackupex_optionscxx . . $ innobackupex_options# |
| 162 |
{ |
| 163 |
OPT_APPLY_LOGcxx . . $ OPT_APPLY_LOG. = 256, |
| 164 |
OPT_COPY_BACKcxx . . $ OPT_COPY_BACK., |
| 165 |
OPT_MOVE_BACKcxx . . $ OPT_MOVE_BACK., |
| 166 |
OPT_REDO_ONLYcxx . . $ OPT_REDO_ONLY., |
| 167 |
OPT_GALERA_INFOcxx . . $ OPT_GALERA_INFO., |
| 168 |
OPT_SLAVE_INFOcxx . . $ OPT_SLAVE_INFO., |
| 169 |
OPT_INCREMENTALcxx . . $ OPT_INCREMENTAL., |
| 170 |
OPT_INCREMENTAL_HISTORY_NAMEcxx . . $ OPT_INCREMENTAL_HISTORY_NAME., |
| 171 |
OPT_INCREMENTAL_HISTORY_UUIDcxx . . $ OPT_INCREMENTAL_HISTORY_UUID., |
| 172 |
OPT_LOCK_WAIT_QUERY_TYPEcxx . . $ OPT_LOCK_WAIT_QUERY_TYPE., |
| 173 |
OPT_KILL_LONG_QUERY_TYPEcxx . . $ OPT_KILL_LONG_QUERY_TYPE., |
| 174 |
OPT_KILL_LONG_QUERIES_TIMEOUTcxx . . $ OPT_KILL_LONG_QUERIES_TIMEOUT., |
| 175 |
OPT_LOCK_WAIT_TIMEOUTcxx . . $ OPT_LOCK_WAIT_TIMEOUT., |
| 176 |
OPT_LOCK_WAIT_THRESHOLDcxx . . $ OPT_LOCK_WAIT_THRESHOLD., |
| 177 |
OPT_DEBUG_SLEEP_BEFORE_UNLOCKcxx . . $ OPT_DEBUG_SLEEP_BEFORE_UNLOCK., |
| 178 |
OPT_NO_LOCKcxx . . $ OPT_NO_LOCK., |
| 179 |
OPT_SAFE_SLAVE_BACKUPcxx . . $ OPT_SAFE_SLAVE_BACKUP., |
| 180 |
OPT_SAFE_SLAVE_BACKUP_TIMEOUTcxx . . $ OPT_SAFE_SLAVE_BACKUP_TIMEOUT., |
| 181 |
OPT_RSYNCcxx . . $ OPT_RSYNC., |
| 182 |
OPT_HISTORYcxx . . $ OPT_HISTORY., |
| 183 |
OPT_INCLUDEcxx . . $ OPT_INCLUDE., |
| 184 |
OPT_FORCE_NON_EMPTY_DIRScxx . . $ OPT_FORCE_NON_EMPTY_DIRS., |
| 185 |
OPT_NO_TIMESTAMPcxx . . $ OPT_NO_TIMESTAMP., |
| 186 |
OPT_NO_VERSION_CHECKcxx . . $ OPT_NO_VERSION_CHECK., |
| 187 |
OPT_NO_BACKUP_LOCKScxx . . $ OPT_NO_BACKUP_LOCKS., |
| 188 |
OPT_DATABASEScxx . . $ OPT_DATABASES., |
| 189 |
OPT_DECOMPRESScxx . . $ OPT_DECOMPRESS., |
| 190 |
|
| 191 |
/* options wich are passed directly to xtrabackup */ |
| 192 |
OPT_CLOSE_FILEScxx . . $ OPT_CLOSE_FILES., |
| 193 |
OPT_COMPACTcxx . . $ OPT_COMPACT., |
| 194 |
OPT_COMPRESScxx . . $ OPT_COMPRESS., |
| 195 |
OPT_COMPRESS_THREADScxx . . $ OPT_COMPRESS_THREADS., |
| 196 |
OPT_COMPRESS_CHUNK_SIZEcxx . . $ OPT_COMPRESS_CHUNK_SIZE., |
| 197 |
OPT_EXPORTcxx . . $ OPT_EXPORT., |
| 198 |
OPT_EXTRA_LSNDIRcxx . . $ OPT_EXTRA_LSNDIR., |
| 199 |
OPT_INCREMENTAL_BASEDIRcxx . . $ OPT_INCREMENTAL_BASEDIR., |
| 200 |
OPT_INCREMENTAL_DIRcxx . . $ OPT_INCREMENTAL_DIR., |
| 201 |
OPT_INCREMENTAL_FORCE_SCANcxx . . $ OPT_INCREMENTAL_FORCE_SCAN., |
| 202 |
OPT_LOG_COPY_INTERVALcxx . . $ OPT_LOG_COPY_INTERVAL., |
| 203 |
OPT_PARALLELcxx . . $ OPT_PARALLEL., |
| 204 |
OPT_REBUILD_INDEXEScxx . . $ OPT_REBUILD_INDEXES., |
| 205 |
OPT_REBUILD_THREADScxx . . $ OPT_REBUILD_THREADS., |
| 206 |
OPT_STREAMcxx . . $ OPT_STREAM., |
| 207 |
OPT_TABLES_FILEcxx . . $ OPT_TABLES_FILE., |
| 208 |
OPT_THROTTLEcxx . . $ OPT_THROTTLE., |
| 209 |
OPT_USE_MEMORYcxx . . $ OPT_USE_MEMORY., |
| 210 |
OPT_INNODB_FORCE_RECOVERYcxx . . $ OPT_INNODB_FORCE_RECOVERY., |
| 211 |
}; |
| 212 |
|
| 213 |
ibx_mode_tcxx . . $ ibx_mode_t# ibx_modecxx . . $ ibx_mode. = IBX_MODE_BACKUPcxx . . $ IBX_MODE_BACKUP.; |
| 214 |
|
| 215 |
static struct my_optioncxx . . $ my_option# ibx_long_optionscxx . . $ ibx_long_options.[] = |
| 216 |
{ |
| 217 |
{"version", 'v', "print version information", |
| 218 |
(ucharcxx . . $ uchar# *) &opt_ibx_versioncxx . . $ opt_ibx_version., (ucharcxx . . $ uchar# *) &opt_ibx_versioncxx . . $ opt_ibx_version., 0, |
| 219 |
GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 220 |
|
| 221 |
{"help", '?', "This option displays a help screen and exits.", |
| 222 |
(ucharcxx . . $ uchar# *) &opt_ibx_helpcxx . . $ opt_ibx_help., (ucharcxx . . $ uchar# *) &opt_ibx_helpcxx . . $ opt_ibx_help., 0, |
| 223 |
GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 224 |
|
| 225 |
{"apply-log", OPT_APPLY_LOGcxx . . $ OPT_APPLY_LOG., "Prepare a backup in BACKUP-DIR by " |
| 226 |
"applying the redo log 'ib_logfile0' and creating new redo log. " |
| 227 |
"The InnoDB configuration is read from the file \"backup-my.cnf\".", |
| 228 |
(ucharcxx . . $ uchar#*) &opt_ibx_apply_logcxx . . $ opt_ibx_apply_log., (ucharcxx . . $ uchar#*) &opt_ibx_apply_logcxx . . $ opt_ibx_apply_log., |
| 229 |
0, GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 230 |
|
| 231 |
{"copy-back", OPT_COPY_BACKcxx . . $ OPT_COPY_BACK., "Copy all the files in a previously made " |
| 232 |
"backup from the backup directory to their original locations.", |
| 233 |
(ucharcxx . . $ uchar# *) &opt_ibx_copy_backcxx . . $ opt_ibx_copy_back., (ucharcxx . . $ uchar# *) &opt_ibx_copy_backcxx . . $ opt_ibx_copy_back., 0, |
| 234 |
GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 235 |
|
| 236 |
{"move-back", OPT_MOVE_BACKcxx . . $ OPT_MOVE_BACK., "Move all the files in a previously made " |
| 237 |
"backup from the backup directory to the actual datadir location. " |
| 238 |
"Use with caution, as it removes backup files.", |
| 239 |
(ucharcxx . . $ uchar# *) &opt_ibx_move_backcxx . . $ opt_ibx_move_back., (ucharcxx . . $ uchar# *) &opt_ibx_move_backcxx . . $ opt_ibx_move_back., 0, |
| 240 |
GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 241 |
|
| 242 |
{"galera-info", OPT_GALERA_INFOcxx . . $ OPT_GALERA_INFO., "This options creates the " |
| 243 |
MB_GALERA_INFOcxx . . $ `extra/mariabackup/backup_copy.h:20:9`! " file which contains the local node state at " |
| 244 |
"the time of the backup. Option should be used when performing the " |
| 245 |
"backup of MariaDB Galera Cluster. Has no effect when backup locks " |
| 246 |
"are used to create the backup.", |
| 247 |
(ucharcxx . . $ uchar# *) &opt_ibx_galera_infocxx . . $ opt_ibx_galera_info., (ucharcxx . . $ uchar# *) &opt_ibx_galera_infocxx . . $ opt_ibx_galera_info., 0, |
| 248 |
GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 249 |
|
| 250 |
{"slave-info", OPT_SLAVE_INFOcxx . . $ OPT_SLAVE_INFO., "This option is useful when backing " |
| 251 |
"up a replication slave server. It prints the binary log position " |
| 252 |
"and name of the master server. It also writes this information to " |
| 253 |
"the \"" MB_SLAVE_INFOcxx . . $ `extra/mariabackup/backup_copy.h:19:9`! "\" file as a \"CHANGE MASTER\" command. " |
| 254 |
"A new slave for this master can be set up by starting a slave server " |
| 255 |
"on this backup and issuing a \"CHANGE MASTER\" command with the " |
| 256 |
"binary log position saved in the \"" MB_SLAVE_INFOcxx . . $ `extra/mariabackup/backup_copy.h:19:9`! "\" file.", |
| 257 |
(ucharcxx . . $ uchar# *) &opt_ibx_slave_infocxx . . $ opt_ibx_slave_info., (ucharcxx . . $ uchar# *) &opt_ibx_slave_infocxx . . $ opt_ibx_slave_info., 0, |
| 258 |
GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 259 |
|
| 260 |
{"incremental", OPT_INCREMENTALcxx . . $ OPT_INCREMENTAL., |
| 261 |
"Create an incremental backup, rather than a full one. When this option is specified, " |
| 262 |
"either --incremental-lsn or --incremental-basedir can also be given. " |
| 263 |
"If neither option is given, option --incremental-basedir is used " |
| 264 |
"by default, set to the first timestamped backup " |
| 265 |
"directory in the backup base directory.", |
| 266 |
(ucharcxx . . $ uchar# *) &opt_ibx_incrementalcxx . . $ opt_ibx_incremental., (ucharcxx . . $ uchar# *) &opt_ibx_incrementalcxx . . $ opt_ibx_incremental., 0, |
| 267 |
GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 268 |
|
| 269 |
{"no-lock", OPT_NO_LOCKcxx . . $ OPT_NO_LOCK., "This option should not be used as " |
| 270 |
"mariadb-backup now is using BACKUP LOCKS, which minimizes the " |
| 271 |
"lock time. ALTER TABLE can run in parallel with BACKUP LOCKS." |
| 272 |
"Use the --no-lock option it only if ALL your " |
| 273 |
"tables are InnoDB and you DO NOT CARE about the binary log " |
| 274 |
"position of the backup. This option shouldn't be used if there " |
| 275 |
"are any DDL statements being executed or if any updates are " |
| 276 |
"happening on non-InnoDB tables (this includes the system MyISAM " |
| 277 |
"tables in the mysql database), otherwise it could lead to an " |
| 278 |
"inconsistent backup. If you are considering to use --no-lock " |
| 279 |
"because your backups are failing to acquire the lock, this could " |
| 280 |
"be because of incoming replication events preventing the lock " |
| 281 |
"from succeeding. Please try using --safe-slave-backup to " |
| 282 |
"momentarily stop the replication slave thread, this may help " |
| 283 |
"the backup to succeed and you then don't need to resort to " |
| 284 |
"using this option.", |
| 285 |
(ucharcxx . . $ uchar# *) &opt_ibx_no_lockcxx . . $ opt_ibx_no_lock., (ucharcxx . . $ uchar# *) &opt_ibx_no_lockcxx . . $ opt_ibx_no_lock., 0, |
| 286 |
GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 287 |
|
| 288 |
{"safe-slave-backup", OPT_SAFE_SLAVE_BACKUPcxx . . $ OPT_SAFE_SLAVE_BACKUP., "Stop slave SQL thread " |
| 289 |
"and wait to start backup until Slave_open_temp_tables in " |
| 290 |
"\"SHOW STATUS\" is zero. If there are no open temporary tables, " |
| 291 |
"the backup will take place, otherwise the SQL thread will be " |
| 292 |
"started and stopped until there are no open temporary tables. " |
| 293 |
"The backup will fail if Slave_open_temp_tables does not become " |
| 294 |
"zero after --safe-slave-backup-timeout seconds. The slave SQL " |
| 295 |
"thread will be restarted when the backup finishes.", |
| 296 |
(ucharcxx . . $ uchar# *) &opt_ibx_safe_slave_backupcxx . . $ opt_ibx_safe_slave_backup., |
| 297 |
(ucharcxx . . $ uchar# *) &opt_ibx_safe_slave_backupcxx . . $ opt_ibx_safe_slave_backup., |
| 298 |
0, GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 299 |
|
| 300 |
{"force-non-empty-directories", OPT_FORCE_NON_EMPTY_DIRScxx . . $ OPT_FORCE_NON_EMPTY_DIRS., "This " |
| 301 |
"option, when specified, makes --copy-back or --move-back transfer " |
| 302 |
"files to non-empty directories. Note that no existing files will be " |
| 303 |
"overwritten. If --copy-back or --move-back has to copy a file from " |
| 304 |
"the backup directory which already exists in the destination " |
| 305 |
"directory, it will still fail with an error.", |
| 306 |
(ucharcxx . . $ uchar# *) &opt_ibx_force_non_empty_dirscxx . . $ opt_ibx_force_non_empty_dirs., |
| 307 |
(ucharcxx . . $ uchar# *) &opt_ibx_force_non_empty_dirscxx . . $ opt_ibx_force_non_empty_dirs., |
| 308 |
0, GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 309 |
|
| 310 |
{"no-timestamp", OPT_NO_TIMESTAMPcxx . . $ OPT_NO_TIMESTAMP., "This option prevents creation of a " |
| 311 |
"time-stamped subdirectory of the BACKUP-ROOT-DIR given on the " |
| 312 |
"command line. When it is specified, the backup is done in " |
| 313 |
"BACKUP-ROOT-DIR instead.", |
| 314 |
(ucharcxx . . $ uchar# *) &opt_ibx_notimestampcxx . . $ opt_ibx_notimestamp., |
| 315 |
(ucharcxx . . $ uchar# *) &opt_ibx_notimestampcxx . . $ opt_ibx_notimestamp., |
| 316 |
0, GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 317 |
|
| 318 |
{"no-version-check", OPT_NO_VERSION_CHECKcxx . . $ OPT_NO_VERSION_CHECK., "This option disables the " |
| 319 |
"version check which is enabled by the --version-check option.", |
| 320 |
(ucharcxx . . $ uchar# *) &opt_ibx_noversioncheckcxx . . $ opt_ibx_noversioncheck., |
| 321 |
(ucharcxx . . $ uchar# *) &opt_ibx_noversioncheckcxx . . $ opt_ibx_noversioncheck., |
| 322 |
0, GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 323 |
|
| 324 |
{"no-backup-locks", OPT_NO_BACKUP_LOCKScxx . . $ OPT_NO_BACKUP_LOCKS., |
| 325 |
"Old disabled option which has no effect anymore.", |
| 326 |
(ucharcxx . . $ uchar# *) 0, (ucharcxx . . $ uchar#*) 0, |
| 327 |
0, GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 328 |
|
| 329 |
{"decompress", OPT_DECOMPRESScxx . . $ OPT_DECOMPRESS., "Decompresses all files with the .qp " |
| 330 |
"extension in a backup previously made with the --compress option.", |
| 331 |
(ucharcxx . . $ uchar# *) &opt_ibx_decompresscxx . . $ opt_ibx_decompress., |
| 332 |
(ucharcxx . . $ uchar# *) &opt_ibx_decompresscxx . . $ opt_ibx_decompress., |
| 333 |
0, GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 334 |
|
| 335 |
{"user", 'u', "This option specifies the MySQL username used " |
| 336 |
"when connecting to the server, if that's not the current user. " |
| 337 |
"The option accepts a string argument. See mysql --help for details.", |
| 338 |
(ucharcxx . . $ uchar#*) &opt_ibx_usercxx . . $ opt_ibx_user., (ucharcxx . . $ uchar#*) &opt_ibx_usercxx . . $ opt_ibx_user., 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, |
| 339 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 340 |
|
| 341 |
{"host", 'H', "This option specifies the host to use when " |
| 342 |
"connecting to the database server with TCP/IP. The option accepts " |
| 343 |
"a string argument. See mysql --help for details.", |
| 344 |
(ucharcxx . . $ uchar#*) &opt_ibx_hostcxx . . $ opt_ibx_host., (ucharcxx . . $ uchar#*) &opt_ibx_hostcxx . . $ opt_ibx_host., 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, |
| 345 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 346 |
|
| 347 |
{"port", 'P', "This option specifies the port to use when " |
| 348 |
"connecting to the database server with TCP/IP. The option accepts " |
| 349 |
"a string argument. See mysql --help for details.", |
| 350 |
&opt_ibx_portcxx . . $ opt_ibx_port., &opt_ibx_portcxx . . $ opt_ibx_port., 0, GET_UINTcxx . . $ `include/my_getopt.h:31:9`!, REQUIRED_ARG, |
| 351 |
0, 0, 0, 0, 0, 0}, |
| 352 |
|
| 353 |
{"password", 'p', "This option specifies the password to use " |
| 354 |
"when connecting to the database. It accepts a string argument. " |
| 355 |
"See mysql --help for details.", |
| 356 |
0, 0, 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, |
| 357 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 358 |
|
| 359 |
{"socket", 'S', "This option specifies the socket to use when " |
| 360 |
"connecting to the local database server with a UNIX domain socket. " |
| 361 |
"The option accepts a string argument. See mysql --help for details.", |
| 362 |
(ucharcxx . . $ uchar#*) &opt_ibx_socketcxx . . $ opt_ibx_socket., (ucharcxx . . $ uchar#*) &opt_ibx_socketcxx . . $ opt_ibx_socket., 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, |
| 363 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 364 |
|
| 365 |
{"incremental-history-name", OPT_INCREMENTAL_HISTORY_NAMEcxx . . $ OPT_INCREMENTAL_HISTORY_NAME., |
| 366 |
"This option specifies the name of the backup series stored in the " |
| 367 |
XB_HISTORY_TABLEcxx . . $ `extra/mariabackup/xtrabackup.h:38:9`! " history record to base an " |
| 368 |
"incremental backup on. Backup will search the history table " |
| 369 |
"looking for the most recent (highest innodb_to_lsn), successful " |
| 370 |
"backup in the series and take the to_lsn value to use as the " |
| 371 |
"starting lsn for the incremental backup. This will be mutually " |
| 372 |
"exclusive with --incremental-history-uuid, --incremental-basedir " |
| 373 |
"and --incremental-lsn. If no valid lsn can be found (no series by " |
| 374 |
"that name, no successful backups by that name), " |
| 375 |
"an error will be returned. It is used with the --incremental option.", |
| 376 |
(ucharcxx . . $ uchar#*) &opt_ibx_incremental_history_namecxx . . $ opt_ibx_incremental_history_name., |
| 377 |
(ucharcxx . . $ uchar#*) &opt_ibx_incremental_history_namecxx . . $ opt_ibx_incremental_history_name., 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, |
| 378 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 379 |
|
| 380 |
{"incremental-history-uuid", OPT_INCREMENTAL_HISTORY_UUIDcxx . . $ OPT_INCREMENTAL_HISTORY_UUID., |
| 381 |
"This option specifies the UUID of the specific history record " |
| 382 |
"stored in the " XB_HISTORY_TABLEcxx . . $ `extra/mariabackup/xtrabackup.h:38:9`! " table to base an " |
| 383 |
"incremental backup on. --incremental-history-name, " |
| 384 |
"--incremental-basedir and --incremental-lsn. If no valid lsn can be " |
| 385 |
"found (no success record with that uuid), an error will be returned." |
| 386 |
" It is used with the --incremental option.", |
| 387 |
(ucharcxx . . $ uchar#*) &opt_ibx_incremental_history_uuidcxx . . $ opt_ibx_incremental_history_uuid., |
| 388 |
(ucharcxx . . $ uchar#*) &opt_ibx_incremental_history_uuidcxx . . $ opt_ibx_incremental_history_uuid., 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, |
| 389 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 390 |
|
| 391 |
{"ftwrl-wait-query-type", OPT_LOCK_WAIT_QUERY_TYPEcxx . . $ OPT_LOCK_WAIT_QUERY_TYPE., |
| 392 |
"Old disabled option which has no effect anymore (not needed " |
| 393 |
"with BACKUP LOCKS)", |
| 394 |
(ucharcxx . . $ uchar#*) 0, (ucharcxx . . $ uchar#*) 0, &query_type_typelibcxx . . $ query_type_typelib., GET_ENUMcxx . . $ `include/my_getopt.h:39:9`!, |
| 395 |
REQUIRED_ARG, QUERY_TYPE_ALLcxx . . $ QUERY_TYPE_ALL., 0, 0, 0, 0, 0}, |
| 396 |
|
| 397 |
{"kill-long-query-type", OPT_KILL_LONG_QUERY_TYPEcxx . . $ OPT_KILL_LONG_QUERY_TYPE., |
| 398 |
"This option specifies which types of queries should be killed to " |
| 399 |
"unblock the global lock. Default is \"all\".", |
| 400 |
(ucharcxx . . $ uchar#*) &opt_ibx_kill_long_query_typecxx . . $ opt_ibx_kill_long_query_type., |
| 401 |
(ucharcxx . . $ uchar#*) &opt_ibx_kill_long_query_typecxx . . $ opt_ibx_kill_long_query_type., &query_type_typelibcxx . . $ query_type_typelib., |
| 402 |
GET_ENUMcxx . . $ `include/my_getopt.h:39:9`!, REQUIRED_ARG, QUERY_TYPE_SELECTcxx . . $ QUERY_TYPE_SELECT., 0, 0, 0, 0, 0}, |
| 403 |
|
| 404 |
{"history", OPT_HISTORYcxx . . $ OPT_HISTORY., |
| 405 |
"This option enables the tracking of backup history in the " |
| 406 |
XB_HISTORY_TABLEcxx . . $ `extra/mariabackup/xtrabackup.h:38:9`! " table. An optional history " |
| 407 |
"series name may be specified that will be placed with the history " |
| 408 |
"record for the current backup being taken.", |
| 409 |
NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
| 410 |
|
| 411 |
{"include", OPT_INCLUDEcxx . . $ OPT_INCLUDE., |
| 412 |
"This option is a regular expression to be matched against table " |
| 413 |
"names in databasename.tablename format. It is passed directly to " |
| 414 |
"--tables option. See the documentation for " |
| 415 |
"details.", |
| 416 |
(ucharcxx . . $ uchar#*) &opt_ibx_includecxx . . $ opt_ibx_include., |
| 417 |
(ucharcxx . . $ uchar#*) &opt_ibx_includecxx . . $ opt_ibx_include., 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, |
| 418 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 419 |
|
| 420 |
{"databases", OPT_DATABASEScxx . . $ OPT_DATABASES., |
| 421 |
"This option specifies the list of databases that innobackupex should " |
| 422 |
"back up. The option accepts a string argument or path to file that " |
| 423 |
"contains the list of databases to back up. The list is of the form " |
| 424 |
"\"databasename1[.table_name1] databasename2[.table_name2] . . .\". " |
| 425 |
"If this option is not specified, all databases containing MyISAM and " |
| 426 |
"InnoDB tables will be backed up. Please make sure that --databases " |
| 427 |
"contains all of the InnoDB databases and tables, so that all of the " |
| 428 |
"innodb.frm files are also backed up. In case the list is very long, " |
| 429 |
"this can be specified in a file, and the full path of the file can " |
| 430 |
"be specified instead of the list. (See option --tables-file.)", |
| 431 |
(ucharcxx . . $ uchar#*) &opt_ibx_databasescxx . . $ opt_ibx_databases., |
| 432 |
(ucharcxx . . $ uchar#*) &opt_ibx_databasescxx . . $ opt_ibx_databases., 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, |
| 433 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 434 |
|
| 435 |
{"kill-long-queries-timeout", OPT_KILL_LONG_QUERIES_TIMEOUTcxx . . $ OPT_KILL_LONG_QUERIES_TIMEOUT., |
| 436 |
"Old disabled option which has no effect anymore (not needed " |
| 437 |
"with BACKUP LOCKS)", |
| 438 |
(ucharcxx . . $ uchar#*) 0, (ucharcxx . . $ uchar#*) 0, 0, GET_UINTcxx . . $ `include/my_getopt.h:31:9`!, |
| 439 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 440 |
|
| 441 |
{"ftwrl-wait-timeout", OPT_LOCK_WAIT_TIMEOUTcxx . . $ OPT_LOCK_WAIT_TIMEOUT., |
| 442 |
"Alias for startup-wait-timeout", |
| 443 |
(ucharcxx . . $ uchar#*) &opt_ibx_lock_wait_timeoutcxx . . $ opt_ibx_lock_wait_timeout., |
| 444 |
(ucharcxx . . $ uchar#*) &opt_ibx_lock_wait_timeoutcxx . . $ opt_ibx_lock_wait_timeout., 0, GET_UINTcxx . . $ `include/my_getopt.h:31:9`!, |
| 445 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 446 |
|
| 447 |
{"startup-wait-timeout", OPT_LOCK_WAIT_TIMEOUTcxx . . $ OPT_LOCK_WAIT_TIMEOUT., |
| 448 |
"This option specifies time in seconds that mariadb-backup should wait for " |
| 449 |
"BACKUP STAGE START to complete. BACKUP STAGE START has to wait until all " |
| •450 |
"currently running queries using explicit LOCK TABLES has ended. " |
| 451 |
"If there are still such queries when the timeout expires, mariadb-backup " |
| 452 |
"terminates with an error. Default is 0, in which case mariadb-backup waits " |
| 453 |
"indefinitely for BACKUP STAGE START to finish", |
| 454 |
(ucharcxx . . $ uchar#*) &opt_ibx_lock_wait_timeoutcxx . . $ opt_ibx_lock_wait_timeout., |
| 455 |
(ucharcxx . . $ uchar#*) &opt_ibx_lock_wait_timeoutcxx . . $ opt_ibx_lock_wait_timeout., 0, GET_UINTcxx . . $ `include/my_getopt.h:31:9`!, |
| 456 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 457 |
|
| 458 |
{"ftwrl-wait-threshold", OPT_LOCK_WAIT_THRESHOLDcxx . . $ OPT_LOCK_WAIT_THRESHOLD., |
| 459 |
"Old disabled option which has no effect anymore (not needed " |
| 460 |
"with BACKUP LOCKS)", |
| 461 |
(ucharcxx . . $ uchar#*) 0, (ucharcxx . . $ uchar#*) 0, 0, GET_UINTcxx . . $ `include/my_getopt.h:31:9`!, |
| 462 |
REQUIRED_ARG, 60, 0, 0, 0, 0, 0}, |
| 463 |
|
| 464 |
{"safe-slave-backup-timeout", OPT_SAFE_SLAVE_BACKUP_TIMEOUTcxx . . $ OPT_SAFE_SLAVE_BACKUP_TIMEOUT., |
| 465 |
"How many seconds --safe-slave-backup should wait for " |
| 466 |
"Slave_open_temp_tables to become zero. (default 300)", |
| 467 |
(ucharcxx . . $ uchar#*) &opt_ibx_safe_slave_backup_timeoutcxx . . $ opt_ibx_safe_slave_backup_timeout., |
| 468 |
(ucharcxx . . $ uchar#*) &opt_ibx_safe_slave_backup_timeoutcxx . . $ opt_ibx_safe_slave_backup_timeout., 0, GET_UINTcxx . . $ `include/my_getopt.h:31:9`!, |
| 469 |
REQUIRED_ARG, 300, 0, 0, 0, 0, 0}, |
| 470 |
|
| 471 |
|
| 472 |
/* Following command-line options are actually handled by xtrabackup. |
| 473 |
We put them here with only purpose for them to showup in |
| 474 |
innobackupex --help output */ |
| 475 |
|
| 476 |
{"close_files", OPT_CLOSE_FILEScxx . . $ OPT_CLOSE_FILES., "Do not keep files opened." |
| 477 |
" Use at your own risk.", |
| 478 |
(ucharcxx . . $ uchar#*) &ibx_xb_close_filescxx . . $ ibx_xb_close_files., (ucharcxx . . $ uchar#*) &ibx_xb_close_filescxx . . $ ibx_xb_close_files., 0, |
| 479 |
GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 480 |
|
| 481 |
{"compress", OPT_COMPRESScxx . . $ OPT_COMPRESS., "This option instructs backup to " |
| 482 |
"compress backup copies of InnoDB data files." |
| 483 |
, (ucharcxx . . $ uchar#*) &ibx_xtrabackup_compress_algcxx . . $ ibx_xtrabackup_compress_alg., |
| 484 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_compress_algcxx . . $ ibx_xtrabackup_compress_alg., 0, |
| 485 |
GET_STRcxx . . $ `include/my_getopt.h:36:9`!, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
| 486 |
|
| 487 |
{"compress-threads", OPT_COMPRESS_THREADScxx . . $ OPT_COMPRESS_THREADS., |
| 488 |
"This option specifies the number of worker threads that will be used " |
| 489 |
"for parallel compression.", |
| 490 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_compress_threadscxx . . $ ibx_xtrabackup_compress_threads., |
| 491 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_compress_threadscxx . . $ ibx_xtrabackup_compress_threads., |
| 492 |
0, GET_UINTcxx . . $ `include/my_getopt.h:31:9`!, REQUIRED_ARG, 1, 1, UINT_MAXcxx . . $ `<external>/67164224788392828/limits.h:124:9`!, 0, 0, 0}, |
| 493 |
|
| 494 |
{"compress-chunk-size", OPT_COMPRESS_CHUNK_SIZEcxx . . $ OPT_COMPRESS_CHUNK_SIZE., "Size of working " |
| 495 |
"buffer(s) for compression threads in bytes. The default value " |
| 496 |
"is 64K.", (ucharcxx . . $ uchar#*) &ibx_xtrabackup_compress_chunk_sizecxx . . $ ibx_xtrabackup_compress_chunk_size., |
| 497 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_compress_chunk_sizecxx . . $ ibx_xtrabackup_compress_chunk_size., |
| 498 |
0, GET_ULLcxx . . $ `include/my_getopt.h:35:9`!, REQUIRED_ARG, (1 << 16), 1024, ULONGLONG_MAXcxx . . $ `include/my_global.h:766:9`!, 0, 0, 0}, |
| 499 |
|
| 500 |
{"export", OPT_EXPORTcxx . . $ OPT_EXPORT., " enables exporting individual tables for import " |
| 501 |
"into another server.", |
| 502 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_exportcxx . . $ ibx_xtrabackup_export., (ucharcxx . . $ uchar#*) &ibx_xtrabackup_exportcxx . . $ ibx_xtrabackup_export., |
| 503 |
0, GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 504 |
|
| 505 |
{"extra-lsndir", OPT_EXTRA_LSNDIRcxx . . $ OPT_EXTRA_LSNDIR., "This option specifies the " |
| 506 |
"directory in which to save an extra copy of the " |
| 507 |
"\"" MB_METADATA_FILENAMEcxx . . $ `extra/mariabackup/backup_copy.h:23:9`! "\" file. The option accepts a string " |
| 508 |
"argument.", |
| 509 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_extra_lsndircxx . . $ ibx_xtrabackup_extra_lsndir., |
| 510 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_extra_lsndircxx . . $ ibx_xtrabackup_extra_lsndir., |
| 511 |
0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 512 |
|
| 513 |
{"incremental-basedir", OPT_INCREMENTAL_BASEDIRcxx . . $ OPT_INCREMENTAL_BASEDIR., "This option " |
| 514 |
"specifies the directory containing the full backup that is the base " |
| 515 |
"dataset for the incremental backup. The option accepts a string " |
| 516 |
"argument. It is used with the --incremental option.", |
| 517 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_incremental_basedircxx . . $ ibx_xtrabackup_incremental_basedir., |
| 518 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_incremental_basedircxx . . $ ibx_xtrabackup_incremental_basedir., |
| 519 |
0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 520 |
|
| 521 |
{"incremental-dir", OPT_INCREMENTAL_DIRcxx . . $ OPT_INCREMENTAL_DIR., "This option specifies the " |
| 522 |
"directory where the incremental backup will be combined with the " |
| 523 |
"full backup to make a new full backup. The option accepts a string " |
| 524 |
"argument. It is used with the --incremental option.", |
| 525 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_incremental_dircxx . . $ ibx_xtrabackup_incremental_dir., |
| 526 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_incremental_dircxx . . $ ibx_xtrabackup_incremental_dir., |
| 527 |
0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 528 |
|
| 529 |
{"incremental-force-scan", OPT_INCREMENTAL_FORCE_SCANcxx . . $ OPT_INCREMENTAL_FORCE_SCAN., |
| 530 |
"Perform full scan of data files " |
| 531 |
"for taking an incremental backup even if full changed page bitmap " |
| 532 |
"data is available to enable the backup without the full scan.", |
| 533 |
(ucharcxx . . $ uchar#*)&ibx_xtrabackup_incremental_force_scancxx . . $ ibx_xtrabackup_incremental_force_scan., |
| 534 |
(ucharcxx . . $ uchar#*)&ibx_xtrabackup_incremental_force_scancxx . . $ ibx_xtrabackup_incremental_force_scan., 0, GET_BOOLcxx . . $ `include/my_getopt.h:29:9`!, NO_ARG, |
| 535 |
0, 0, 0, 0, 0, 0}, |
| 536 |
|
| 537 |
{"log-copy-interval", OPT_LOG_COPY_INTERVALcxx . . $ OPT_LOG_COPY_INTERVAL., "This option specifies " |
| 538 |
"time interval between checks done by log copying thread in " |
| 539 |
"milliseconds.", (ucharcxx . . $ uchar#*) &ibx_xtrabackup_log_copy_intervalcxx . . $ ibx_xtrabackup_log_copy_interval., |
| 540 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_log_copy_intervalcxx . . $ ibx_xtrabackup_log_copy_interval., |
| 541 |
0, GET_LONGcxx . . $ `include/my_getopt.h:32:9`!, REQUIRED_ARG, 1000, 0, LONG_MAXcxx . . $ `<external>/67164224788392828/limits.h:131:9`!, 0, 1, 0}, |
| 542 |
|
| 543 |
{"incremental-lsn", OPT_INCREMENTALcxx . . $ OPT_INCREMENTAL., "This option specifies the log " |
| 544 |
"sequence number (LSN) to use for the incremental backup. The option " |
| 545 |
"accepts a string argument. It is used with the --incremental option. " |
| 546 |
"It is used instead of specifying --incremental-basedir. For " |
| 547 |
"databases created by MySQL and Percona Server 5.0-series versions, " |
| 548 |
"specify the LSN as two 32-bit integers in high:low format. For " |
| 549 |
"databases created in 5.1 and later, specify the LSN as a single " |
| 550 |
"64-bit integer.", |
| 551 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_incrementalcxx . . $ ibx_xtrabackup_incremental., |
| 552 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_incrementalcxx . . $ ibx_xtrabackup_incremental., |
| 553 |
0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 554 |
|
| 555 |
{"parallel", OPT_PARALLELcxx . . $ OPT_PARALLEL., "On backup, this option specifies the " |
| 556 |
"number of threads to use to back " |
| 557 |
"up files concurrently. The option accepts an integer argument.", |
| 558 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_parallelcxx . . $ ibx_xtrabackup_parallel., (ucharcxx . . $ uchar#*) &ibx_xtrabackup_parallelcxx . . $ ibx_xtrabackup_parallel., |
| 559 |
0, GET_INTcxx . . $ `include/my_getopt.h:30:9`!, REQUIRED_ARG, 1, 1, INT_MAXcxx . . $ `<external>/67164224788392828/limits.h:120:9`!, 0, 0, 0}, |
| 560 |
|
| 561 |
|
| 562 |
{"stream", OPT_STREAMcxx . . $ OPT_STREAM., "This option specifies the format in which to " |
| 563 |
"do the streamed backup. The option accepts a string argument. The " |
| 564 |
"backup will be done to STDOUT in the specified format. Currently, " |
| 565 |
"the only supported formats are tar and mbstream/xbstream.", |
| 566 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_stream_strcxx . . $ ibx_xtrabackup_stream_str., |
| 567 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_stream_strcxx . . $ ibx_xtrabackup_stream_str., 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, |
| 568 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 569 |
|
| 570 |
{"tables-file", OPT_TABLES_FILEcxx . . $ OPT_TABLES_FILE., "This option specifies the file in " |
| 571 |
"which there are a list of names of the form database. The option " |
| 572 |
"accepts a string argument.table, one per line.", |
| 573 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_tables_filecxx . . $ ibx_xtrabackup_tables_file., |
| 574 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_tables_filecxx . . $ ibx_xtrabackup_tables_file., |
| 575 |
0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 576 |
|
| 577 |
{"throttle", OPT_THROTTLEcxx . . $ OPT_THROTTLE., "This option specifies a number of I/O " |
| 578 |
"operations (pairs of read+write) per second. It accepts an integer " |
| 579 |
"argument.", |
| 580 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_throttlecxx . . $ ibx_xtrabackup_throttle., (ucharcxx . . $ uchar#*) &ibx_xtrabackup_throttlecxx . . $ ibx_xtrabackup_throttle., |
| 581 |
0, GET_LONGcxx . . $ `include/my_getopt.h:32:9`!, REQUIRED_ARG, 0, 0, LONG_MAXcxx . . $ `<external>/67164224788392828/limits.h:131:9`!, 0, 1, 0}, |
| 582 |
|
| 583 |
{"tmpdir", 't', "This option specifies the location where a temporary " |
| 584 |
"files will be stored. If the option is not specified, the default is " |
| 585 |
"to use the value of tmpdir read from the server configuration.", |
| 586 |
(ucharcxx . . $ uchar#*) &ibx_opt_mysql_tmpdircxx . . $ ibx_opt_mysql_tmpdir., |
| 587 |
(ucharcxx . . $ uchar#*) &ibx_opt_mysql_tmpdircxx . . $ ibx_opt_mysql_tmpdir., 0, GET_STRcxx . . $ `include/my_getopt.h:36:9`!, REQUIRED_ARG, |
| 588 |
0, 0, 0, 0, 0, 0}, |
| 589 |
|
| 590 |
{"use-memory", OPT_USE_MEMORYcxx . . $ OPT_USE_MEMORY., "This option accepts a string argument " |
| 591 |
"that specifies the amount of memory in bytes to use " |
| 592 |
"for crash recovery while preparing a backup. Multiples are supported " |
| 593 |
"providing the unit (e.g. 1MB, 1GB). It is used only with the option " |
| 594 |
"--apply-log.", |
| 595 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_use_memorycxx . . $ ibx_xtrabackup_use_memory., |
| 596 |
(ucharcxx . . $ uchar#*) &ibx_xtrabackup_use_memorycxx . . $ ibx_xtrabackup_use_memory., |
| 597 |
0, GET_LLcxx . . $ `include/my_getopt.h:34:9`!, REQUIRED_ARG, 96 << 20, |
| 598 |
innodb_buffer_pool_extent_sizecxx . . $ innodb_buffer_pool_extent_size., SIZE_T_MAXcxx . . $ `include/my_global.h:797:9`!, 0, |
| 599 |
innodb_buffer_pool_extent_sizecxx . . $ innodb_buffer_pool_extent_size., 0}, |
| 600 |
|
| 601 |
{"innodb-force-recovery", OPT_INNODB_FORCE_RECOVERYcxx . . $ OPT_INNODB_FORCE_RECOVERY., |
| 602 |
"This option starts up the embedded InnoDB instance in crash " |
| 603 |
"recovery mode to ignore page corruption; should be used " |
| 604 |
"with the \"--apply-log\" option, in emergencies only. The " |
| 605 |
"default value is 0. Refer to \"innodb_force_recovery\" server " |
| 606 |
"system variable documentation for more details.", |
| 607 |
(ucharcxx . . $ uchar#*)&xtrabackup_innodb_force_recoverycxx . . $ xtrabackup_innodb_force_recovery., |
| 608 |
(ucharcxx . . $ uchar#*)&xtrabackup_innodb_force_recoverycxx . . $ xtrabackup_innodb_force_recovery., |
| 609 |
0, GET_ULONGcxx . . $ `include/my_getopt.h:33:9`!, OPT_ARG, 0, 0, SRV_FORCE_IGNORE_CORRUPTcxx . . $ SRV_FORCE_IGNORE_CORRUPT., 0, 0, 0}, |
| 610 |
|
| 611 |
{ 0, 0, 0, 0, 0, 0, GET_NO_ARGcxx . . $ `include/my_getopt.h:28:9`!, NO_ARG, 0, 0, 0, 0, 0, 0} |
| 612 |
}; |
| 613 |
|
| 614 |
|
| 615 |
static void usagecxx . . $ usage(49f6e7a06ebc5aa8).(void) |
| 616 |
{ |
| 617 |
puts("Open source backup tool\n\ |
| 618 |
\n\ |
| 619 |
Copyright (C) 2009-2015 Percona LLC and/or its affiliates.\n\ |
| 620 |
Portions Copyright (C) 2000, 2011, MySQL AB & Innobase Oy. All Rights Reserved.\n\ |
| 621 |
\n\ |
| 622 |
This program is free software; you can redistribute it and/or\n\ |
| 623 |
modify it under the terms of the GNU General Public License\n\ |
| 624 |
as published by the Free Software Foundation version 2\n\ |
| 625 |
of the License.\n\ |
| 626 |
\n\ |
| 627 |
This program is distributed in the hope that it will be useful,\n\ |
| 628 |
but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ |
| 629 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ |
| 630 |
GNU General Public License for more details.\n\ |
| 631 |
\n\ |
| 632 |
You can download full text of the license on http://www.gnu.org/licenses/gpl-2.0.txt\n\n"); |
| 633 |
|
| 634 |
puts("innobackupex - Non-blocking backup tool for InnoDB, XtraDB and HailDB databases\n\ |
| 635 |
\n\ |
| 636 |
SYNOPOSIS\n\ |
| 637 |
\n\ |
| 638 |
innobackupex [--compress] [--compress-threads=NUMBER-OF-THREADS] [--compress-chunk-size=CHUNK-SIZE]\n\ |
| 639 |
[--include=REGEXP] [--user=NAME]\n\ |
| 640 |
[--password=WORD] [--port=PORT] [--socket=SOCKET]\n\ |
| 641 |
[--no-timestamp] [--ibbackup=IBBACKUP-BINARY]\n\ |
| 642 |
[--slave-info] [--galera-info] [--stream=tar|mbstream|xbstream]\n\ |
| 643 |
[--defaults-file=MY.CNF] [--defaults-group=GROUP-NAME]\n\ |
| 644 |
[--databases=LIST] [--no-lock] \n\ |
| 645 |
[--tmpdir=DIRECTORY] [--tables-file=FILE]\n\ |
| 646 |
[--history=NAME]\n\ |
| 647 |
[--incremental] [--incremental-basedir]\n\ |
| 648 |
[--incremental-dir] [--incremental-force-scan] [--incremental-lsn]\n\ |
| 649 |
[--incremental-history-name=NAME] [--incremental-history-uuid=UUID]\n\ |
| 650 |
[--close-files]\n\ |
| 651 |
BACKUP-ROOT-DIR\n\ |
| 652 |
\n\ |
| 653 |
innobackupex --apply-log [--use-memory=B]\n\ |
| 654 |
[--defaults-file=MY.CNF]\n\ |
| 655 |
[--export] [--ibbackup=IBBACKUP-BINARY]\n\ |
| 656 |
[--innodb-force-recovery=1]\n\ |
| 657 |
BACKUP-DIR\n\ |
| 658 |
\n\ |
| 659 |
innobackupex --copy-back [--defaults-file=MY.CNF] [--defaults-group=GROUP-NAME] BACKUP-DIR\n\ |
| 660 |
\n\ |
| 661 |
innobackupex --move-back [--defaults-file=MY.CNF] [--defaults-group=GROUP-NAME] BACKUP-DIR\n\ |
| 662 |
\n\ |
| 663 |
innobackupex [--decompress]\n\ |
| 664 |
[--parallel=NUMBER-OF-FORKS] BACKUP-DIR\n\ |
| 665 |
\n\ |
| 666 |
DESCRIPTION\n\ |
| 667 |
\n\ |
| 668 |
The first command line above makes a hot backup of a database.\n\ |
| 669 |
By default it creates a backup directory (named by the current date\n\ |
| 670 |
and time) in the given backup root directory. With the --no-timestamp\n\ |
| 671 |
option it does not create a time-stamped backup directory, but it puts\n\ |
| 672 |
the backup in the given directory (which must not exist). This\n\ |
| 673 |
command makes a complete backup of all MyISAM and InnoDB tables and\n\ |
| 674 |
indexes in all databases or in all of the databases specified with the\n\ |
| 675 |
--databases option. The created backup contains .frm, .MRG, .MYD,\n\ |
| 676 |
.MYI, .MAD, .MAI, .TRG, .TRN, .ARM, .ARZ, .CSM, CSV, .opt, .par, and\n\ |
| 677 |
InnoDB data and log files. The MY.CNF options file defines the\n\ |
| 678 |
location of the database.\n\ |
| 679 |
\n\ |
| 680 |
The --apply-log command prepares a backup for starting a MySQL\n\ |
| 681 |
server on the backup. This command recovers InnoDB data files as specified\n\ |
| 682 |
in BACKUP-DIR/backup-my.cnf using BACKUP-DIR/ib_logfile0,\n\ |
| 683 |
and creates new InnoDB log files as specified in BACKUP-DIR/backup-my.cnf.\n\ |
| 684 |
The BACKUP-DIR should be the path to a backup directory\n\ |
| 685 |
\n\ |
| 686 |
The --copy-back command copies data, index, and log files\n\ |
| 687 |
from the backup directory back to their original locations.\n\ |
| 688 |
The MY.CNF options file defines the original location of the database.\n\ |
| 689 |
The BACKUP-DIR is the path to a backup directory.\n\ |
| 690 |
\n\ |
| 691 |
The --move-back command is similar to --copy-back with the only difference that\n\ |
| 692 |
it moves files to their original locations rather than copies them. As this\n\ |
| 693 |
option removes backup files, it must be used with caution. It may be useful in\n\ |
| 694 |
cases when there is not enough free disk space to copy files.\n\ |
| 695 |
\n\ |
| 696 |
The --decompress command will decompress a backup made\n\ |
| 697 |
with the --compress option. The\n\ |
| 698 |
--parallel option will allow multiple files to be decompressed\n\ |
| 699 |
simultaneously. In order to decompress, the qpress utility MUST be installed\n\ |
| 700 |
and accessible within the path. This process will remove the original\n\ |
| 701 |
compressed files and leave the results in the same location.\n\ |
| 702 |
\n\ |
| 703 |
On success the exit code innobackupex is 0. A non-zero exit code \n\ |
| 704 |
indicates an error.\n"); |
| 705 |
printf("Usage: [%s [--defaults-file=#] --backup | %s [--defaults-file=#] --prepare] [OPTIONS]\n", my_progname, my_progname); |
| 706 |
my_print_help(ibx_long_optionscxx . . $ ibx_long_options.); |
| 707 |
} |
| 708 |
|
| 709 |
|
| 710 |
static |
| 711 |
my_boolcxx . . $ my_bool# |
| 712 |
ibx_get_one_optioncxx . . $ ibx_get_one_option(2c7df8dda614b8e6).(const struct my_optioncxx . . $ my_option# *opt, |
| 713 |
const char *argument, const char *) |
| 714 |
{ |
| 715 |
switch(opt->idcxx . . $ my_option#id.) { |
| 716 |
case '?': |
| 717 |
usagecxx . . $ usage(49f6e7a06ebc5aa8).(); |
| 718 |
exitcxx . . $ exit(44ed87f96534fad7).(0); |
| 719 |
break; |
| 720 |
case 'v': |
| 721 |
printf("innobackupex version %s %s (%s)", |
| 722 |
MYSQL_SERVER_VERSIONcxx . . $ `build/include/mysql_version.h:14:9`!, |
| 723 |
SYSTEM_TYPEcxx . . $ `build/include/my_config.h:397:9`!, MACHINE_TYPEcxx . . $ `build/include/my_config.h:398:9`!); |
| 724 |
exitcxx . . $ exit(44ed87f96534fad7).(0); |
| 725 |
break; |
| 726 |
case OPT_HISTORYcxx . . $ OPT_HISTORY.: |
| 727 |
if (argument) { |
| 728 |
opt_ibx_historycxx . . $ opt_ibx_history. = argument; |
| 729 |
} else { |
| 730 |
opt_ibx_historycxx . . $ opt_ibx_history. = ""; |
| 731 |
} |
| 732 |
break; |
| 733 |
case OPT_STREAMcxx . . $ OPT_STREAM.: |
| 734 |
if (!strcasecmp(argument, "mbstream") || |
| 735 |
!strcasecmp(argument, "xbstream")) |
| 736 |
xtrabackup_stream_fmtcxx . . $ xtrabackup_stream_fmt. = XB_STREAM_FMT_XBSTREAMcxx . . $ XB_STREAM_FMT_XBSTREAM.; |
| 737 |
else { |
| 738 |
ibx_msgcxx . . $ ibx_msg(581fddd72a8db8fc).("Invalid --stream argument: %s\n", argument); |
| 739 |
return 1; |
| 740 |
} |
| 741 |
xtrabackup_streamcxx . . $ xtrabackup_stream. = TRUEcxx . . $ `include/my_global.h:476:9`!; |
| 742 |
break; |
| 743 |
case OPT_COMPRESScxx . . $ OPT_COMPRESS.: |
| 744 |
if (argument == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 745 |
xtrabackup_compress_algcxx . . $ xtrabackup_compress_alg. = "quicklz"; |
| 746 |
else if (strcasecmp(argument, "quicklz")) |
| 747 |
{ |
| 748 |
ibx_msgcxx . . $ ibx_msg(581fddd72a8db8fc).("Invalid --compress argument: %s\n", argument); |
| 749 |
return 1; |
| 750 |
} |
| 751 |
xtrabackup_compresscxx . . $ xtrabackup_compress. = TRUEcxx . . $ `include/my_global.h:476:9`!; |
| 752 |
break; |
| 753 |
case 'p': |
| 754 |
opt_ibx_passwordcxx . . $ opt_ibx_password.= argument; |
| 755 |
break; |
| 756 |
} |
| 757 |
return(0); |
| 758 |
} |
| 759 |
|
| 760 |
bool |
| 761 |
make_backup_dircxx . . $ make_backup_dir(c9857a73d68e59ba).() |
| 762 |
{ |
| 763 |
time_tcxx . . $ time_t# t = time(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 764 |
char buf[100]; |
| 765 |
|
| 766 |
if (!opt_ibx_notimestampcxx . . $ opt_ibx_notimestamp. && !ibx_xtrabackup_stream_strcxx . . $ ibx_xtrabackup_stream_str.) { |
| 767 |
strftime(buf, sizeof(buf), "%Y-%m-%d_%H-%M-%S", localtime(&t)); |
| 768 |
ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(asprintf(&ibx_backup_directory, "%s/%s", |
| 769 |
ibx_position_arg, buf) != -1); |
| 770 |
} else { |
| 771 |
ibx_backup_directorycxx . . $ ibx_backup_directory. = strdup(ibx_position_argcxx . . $ ibx_position_arg.); |
| 772 |
} |
| 773 |
|
| 774 |
if (!directory_existscxx . . $ directory_exists(e96b1cf346ae2c6).(ibx_backup_directorycxx . . $ ibx_backup_directory., true)) { |
| 775 |
return(false); |
| 776 |
} |
| 777 |
|
| 778 |
return(true); |
| 779 |
} |
| 780 |
|
| 781 |
bool |
| 782 |
ibx_handle_optionscxx . . $ ibx_handle_options(cd109c4ed0025f1f).(int *argc, char ***argv) |
| 783 |
{ |
| 784 |
int i, n_arguments; |
| 785 |
|
| 786 |
if (handle_options(argc, argv, ibx_long_optionscxx . . $ ibx_long_options., ibx_get_one_optioncxx . . $ ibx_get_one_option(2c7df8dda614b8e6).)) { |
| 787 |
return(false); |
| 788 |
} |
| 789 |
|
| 790 |
if (opt_ibx_apply_logcxx . . $ opt_ibx_apply_log.) { |
| 791 |
ibx_modecxx . . $ ibx_mode. = IBX_MODE_APPLY_LOGcxx . . $ IBX_MODE_APPLY_LOG.; |
| 792 |
} else if (opt_ibx_copy_backcxx . . $ opt_ibx_copy_back.) { |
| 793 |
ibx_modecxx . . $ ibx_mode. = IBX_MODE_COPY_BACKcxx . . $ IBX_MODE_COPY_BACK.; |
| 794 |
} else if (opt_ibx_move_backcxx . . $ opt_ibx_move_back.) { |
| 795 |
ibx_modecxx . . $ ibx_mode. = IBX_MODE_MOVE_BACKcxx . . $ IBX_MODE_MOVE_BACK.; |
| 796 |
} else if (opt_ibx_decompresscxx . . $ opt_ibx_decompress.) { |
| 797 |
ibx_modecxx . . $ ibx_mode. = IBX_MODE_DECRYPT_DECOMPRESScxx . . $ IBX_MODE_DECRYPT_DECOMPRESS.; |
| 798 |
} else { |
| 799 |
ibx_modecxx . . $ ibx_mode. = IBX_MODE_BACKUPcxx . . $ IBX_MODE_BACKUP.; |
| 800 |
} |
| 801 |
|
| 802 |
/* find and save position argument */ |
| 803 |
i = 0; |
| 804 |
n_arguments = 0; |
| 805 |
while (i < *argc) { |
| 806 |
char *opt = (*argv)[i]; |
| 807 |
|
| 808 |
if (strncmp(opt, "--", 2) != 0 |
| 809 |
&& !(strlen(opt) == 2 && opt[0] == '-')) { |
| 810 |
if (ibx_position_argcxx . . $ ibx_position_arg. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! |
| 811 |
&& ibx_position_argcxx . . $ ibx_position_arg. != opt) { |
| 812 |
ibx_msgcxx . . $ ibx_msg(581fddd72a8db8fc).("Error: extra argument found %s\n", |
| 813 |
opt); |
| 814 |
} |
| 815 |
ibx_position_argcxx . . $ ibx_position_arg. = opt; |
| 816 |
++n_arguments; |
| 817 |
} |
| 818 |
++i; |
| 819 |
} |
| 820 |
|
| 821 |
*argc -= n_arguments; |
| 822 |
if (n_arguments > 1) { |
| 823 |
return(false); |
| 824 |
} |
| 825 |
|
| 826 |
if (ibx_position_argcxx . . $ ibx_position_arg. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 827 |
ibx_msgcxx . . $ ibx_msg(581fddd72a8db8fc).("Missing argument\n"); |
| 828 |
return(false); |
| 829 |
} |
| 830 |
|
| 831 |
/* set argv[0] to be the program name */ |
| 832 |
--(*argv); |
| 833 |
++(*argc); |
| 834 |
|
| 835 |
return(true); |
| 836 |
} |
| 837 |
|
| 838 |
/*********************************************************************//** |
| 839 |
Parse command-line options, connect to MySQL server, |
| 840 |
detect server capabilities, etc. |
| 841 |
@return true on success. */ |
| 842 |
bool |
| 843 |
ibx_initcxx . . $ ibx_init(c9857a73d68e59ba).() |
| 844 |
{ |
| 845 |
const char *run; |
| 846 |
|
| 847 |
/*=====================*/ |
| 848 |
xtrabackup_copy_backcxx . . $ xtrabackup_copy_back. = opt_ibx_copy_backcxx . . $ opt_ibx_copy_back.; |
| 849 |
xtrabackup_move_backcxx . . $ xtrabackup_move_back. = opt_ibx_move_backcxx . . $ opt_ibx_move_back.; |
| 850 |
opt_galera_infocxx . . $ opt_galera_info. = opt_ibx_galera_infocxx . . $ opt_ibx_galera_info.; |
| 851 |
opt_slave_infocxx . . $ opt_slave_info. = opt_ibx_slave_infocxx . . $ opt_ibx_slave_info.; |
| 852 |
opt_no_lockcxx . . $ opt_no_lock. = opt_ibx_no_lockcxx . . $ opt_ibx_no_lock.; |
| 853 |
opt_safe_slave_backupcxx . . $ opt_safe_slave_backup. = opt_ibx_safe_slave_backupcxx . . $ opt_ibx_safe_slave_backup.; |
| 854 |
opt_force_non_empty_dirscxx . . $ opt_force_non_empty_dirs. = opt_ibx_force_non_empty_dirscxx . . $ opt_ibx_force_non_empty_dirs.; |
| 855 |
opt_noversioncheckcxx . . $ opt_noversioncheck. = opt_ibx_noversioncheckcxx . . $ opt_ibx_noversioncheck.; |
| 856 |
opt_decompresscxx . . $ opt_decompress. = opt_ibx_decompresscxx . . $ opt_ibx_decompress.; |
| 857 |
|
| 858 |
opt_incremental_history_namecxx . . $ opt_incremental_history_name. = opt_ibx_incremental_history_namecxx . . $ opt_ibx_incremental_history_name.; |
| 859 |
opt_incremental_history_uuidcxx . . $ opt_incremental_history_uuid. = opt_ibx_incremental_history_uuidcxx . . $ opt_ibx_incremental_history_uuid.; |
| 860 |
|
| 861 |
opt_usercxx . . $ opt_user. = opt_ibx_usercxx . . $ opt_ibx_user.; |
| 862 |
opt_passwordcxx . . $ opt_password. = opt_ibx_passwordcxx . . $ opt_ibx_password.; |
| 863 |
opt_hostcxx . . $ opt_host. = opt_ibx_hostcxx . . $ opt_ibx_host.; |
| 864 |
opt_defaults_groupcxx . . $ opt_defaults_group. = opt_ibx_defaults_groupcxx . . $ opt_ibx_defaults_group.; |
| 865 |
opt_socketcxx . . $ opt_socket. = opt_ibx_socketcxx . . $ opt_ibx_socket.; |
| 866 |
opt_portcxx . . $ opt_port. = opt_ibx_portcxx . . $ opt_ibx_port.; |
| 867 |
|
| 868 |
opt_lock_wait_query_typecxx . . $ opt_lock_wait_query_type. = opt_ibx_lock_wait_query_typecxx . . $ opt_ibx_lock_wait_query_type.; |
| 869 |
opt_kill_long_query_typecxx . . $ opt_kill_long_query_type. = opt_ibx_kill_long_query_typecxx . . $ opt_ibx_kill_long_query_type.; |
| 870 |
|
| 871 |
opt_kill_long_queries_timeoutcxx . . $ opt_kill_long_queries_timeout. = opt_ibx_kill_long_queries_timeoutcxx . . $ opt_ibx_kill_long_queries_timeout.; |
| 872 |
opt_lock_wait_timeoutcxx . . $ opt_lock_wait_timeout. = opt_ibx_lock_wait_timeoutcxx . . $ opt_ibx_lock_wait_timeout.; |
| 873 |
opt_lock_wait_thresholdcxx . . $ opt_lock_wait_threshold. = opt_ibx_lock_wait_thresholdcxx . . $ opt_ibx_lock_wait_threshold.; |
| 874 |
opt_debug_sleep_before_unlockcxx . . $ opt_debug_sleep_before_unlock. = opt_ibx_debug_sleep_before_unlockcxx . . $ opt_ibx_debug_sleep_before_unlock.; |
| 875 |
opt_safe_slave_backup_timeoutcxx . . $ opt_safe_slave_backup_timeout. = opt_ibx_safe_slave_backup_timeoutcxx . . $ opt_ibx_safe_slave_backup_timeout.; |
| 876 |
|
| 877 |
opt_historycxx . . $ opt_history. = opt_ibx_historycxx . . $ opt_ibx_history.; |
| 878 |
|
| 879 |
/* setup xtrabackup options */ |
| 880 |
xb_close_filescxx . . $ xb_close_files. = ibx_xb_close_filescxx . . $ ibx_xb_close_files.; |
| 881 |
xtrabackup_compress_algcxx . . $ xtrabackup_compress_alg. = ibx_xtrabackup_compress_algcxx . . $ ibx_xtrabackup_compress_alg.; |
| 882 |
xtrabackup_compress_threadscxx . . $ xtrabackup_compress_threads. = ibx_xtrabackup_compress_threadscxx . . $ ibx_xtrabackup_compress_threads.; |
| 883 |
xtrabackup_compress_chunk_sizecxx . . $ xtrabackup_compress_chunk_size. = ibx_xtrabackup_compress_chunk_sizecxx . . $ ibx_xtrabackup_compress_chunk_size.; |
| 884 |
xtrabackup_exportcxx . . $ xtrabackup_export. = ibx_xtrabackup_exportcxx . . $ ibx_xtrabackup_export.; |
| 885 |
xtrabackup_extra_lsndircxx . . $ xtrabackup_extra_lsndir. = ibx_xtrabackup_extra_lsndircxx . . $ ibx_xtrabackup_extra_lsndir.; |
| 886 |
xtrabackup_incremental_basedircxx . . $ xtrabackup_incremental_basedir. = ibx_xtrabackup_incremental_basedircxx . . $ ibx_xtrabackup_incremental_basedir.; |
| 887 |
xtrabackup_incremental_dircxx . . $ xtrabackup_incremental_dir. = ibx_xtrabackup_incremental_dircxx . . $ ibx_xtrabackup_incremental_dir.; |
| 888 |
xtrabackup_incremental_force_scancxx . . $ xtrabackup_incremental_force_scan. = |
| 889 |
ibx_xtrabackup_incremental_force_scancxx . . $ ibx_xtrabackup_incremental_force_scan.; |
| 890 |
xtrabackup_log_copy_intervalcxx . . $ xtrabackup_log_copy_interval. = ibx_xtrabackup_log_copy_intervalcxx . . $ ibx_xtrabackup_log_copy_interval.; |
| 891 |
xtrabackup_incrementalcxx . . $ xtrabackup_incremental. = ibx_xtrabackup_incrementalcxx . . $ ibx_xtrabackup_incremental.; |
| 892 |
xtrabackup_parallelcxx . . $ xtrabackup_parallel. = ibx_xtrabackup_parallelcxx . . $ ibx_xtrabackup_parallel.; |
| 893 |
xtrabackup_stream_strcxx . . $ xtrabackup_stream_str. = ibx_xtrabackup_stream_strcxx . . $ ibx_xtrabackup_stream_str.; |
| 894 |
xtrabackup_tables_filecxx . . $ xtrabackup_tables_file. = ibx_xtrabackup_tables_filecxx . . $ ibx_xtrabackup_tables_file.; |
| 895 |
xtrabackup_throttlecxx . . $ xtrabackup_throttle. = ibx_xtrabackup_throttlecxx . . $ ibx_xtrabackup_throttle.; |
| 896 |
opt_mysql_tmpdircxx . . $ opt_mysql_tmpdir. = ibx_opt_mysql_tmpdircxx . . $ ibx_opt_mysql_tmpdir.; |
| 897 |
xtrabackup_use_memorycxx . . $ xtrabackup_use_memory. = ibx_xtrabackup_use_memorycxx . . $ ibx_xtrabackup_use_memory.; |
| 898 |
|
| 899 |
if (!opt_ibx_incrementalcxx . . $ opt_ibx_incremental. |
| 900 |
&& (xtrabackup_incrementalcxx . . $ xtrabackup_incremental. |
| 901 |
|| xtrabackup_incremental_basedircxx . . $ xtrabackup_incremental_basedir. |
| 902 |
|| opt_ibx_incremental_history_namecxx . . $ opt_ibx_incremental_history_name. |
| 903 |
|| opt_ibx_incremental_history_uuidcxx . . $ opt_ibx_incremental_history_uuid.)) { |
| 904 |
ibx_msgcxx . . $ ibx_msg(581fddd72a8db8fc).("Error: --incremental-lsn, --incremental-basedir, " |
| 905 |
"--incremental-history-name and " |
| 906 |
"--incremental-history-uuid require the " |
| 907 |
"--incremental option.\n"); |
| 908 |
return(false); |
| 909 |
} |
| 910 |
|
| 911 |
if (opt_ibx_databasescxx . . $ opt_ibx_databases. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 912 |
if (is_path_separatorcxx . . $ is_path_separator(b5fd09639b7a0261).(*opt_ibx_databasescxx . . $ opt_ibx_databases.)) { |
| 913 |
xtrabackup_databases_filecxx . . $ xtrabackup_databases_file. = opt_ibx_databasescxx . . $ opt_ibx_databases.; |
| 914 |
} else { |
| 915 |
xtrabackup_databasescxx . . $ xtrabackup_databases. = opt_ibx_databasescxx . . $ opt_ibx_databases.; |
| 916 |
} |
| 917 |
} |
| 918 |
|
| 919 |
/* --tables and --tables-file options are xtrabackup only */ |
| 920 |
ibx_partial_backupcxx . . $ ibx_partial_backup. = (opt_ibx_includecxx . . $ opt_ibx_include. || opt_ibx_databasescxx . . $ opt_ibx_databases.); |
| 921 |
|
| 922 |
if (ibx_modecxx . . $ ibx_mode. == IBX_MODE_BACKUPcxx . . $ IBX_MODE_BACKUP.) { |
| 923 |
|
| 924 |
if (!make_backup_dircxx . . $ make_backup_dir(c9857a73d68e59ba).()) { |
| 925 |
return(false); |
| 926 |
} |
| 927 |
} |
| 928 |
|
| 929 |
/* --binlog-info is xtrabackup only, so force |
| 930 |
--binlog-info=ON. i.e. behavior before the feature had been |
| 931 |
implemented */ |
| 932 |
opt_binlog_infocxx . . $ opt_binlog_info. = BINLOG_INFO_ONcxx . . $ BINLOG_INFO_ON.; |
| 933 |
|
| 934 |
switch (ibx_modecxx . . $ ibx_mode.) { |
| 935 |
case IBX_MODE_APPLY_LOGcxx . . $ IBX_MODE_APPLY_LOG.: |
| 936 |
xtrabackup_preparecxx . . $ xtrabackup_prepare. = TRUEcxx . . $ `include/my_global.h:476:9`!; |
| 937 |
xtrabackup_target_dircxx . . $ xtrabackup_target_dir. = ibx_position_argcxx . . $ ibx_position_arg.; |
| 938 |
run = "apply-log"; |
| 939 |
break; |
| 940 |
case IBX_MODE_BACKUPcxx . . $ IBX_MODE_BACKUP.: |
| 941 |
xtrabackup_backupcxx . . $ xtrabackup_backup. = TRUEcxx . . $ `include/my_global.h:476:9`!; |
| 942 |
xtrabackup_target_dircxx . . $ xtrabackup_target_dir. = ibx_backup_directorycxx . . $ ibx_backup_directory.; |
| 943 |
if (opt_ibx_includecxx . . $ opt_ibx_include. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 944 |
xtrabackup_tablescxx . . $ xtrabackup_tables. = opt_ibx_includecxx . . $ opt_ibx_include.; |
| 945 |
} |
| 946 |
run = "backup"; |
| 947 |
break; |
| 948 |
case IBX_MODE_COPY_BACKcxx . . $ IBX_MODE_COPY_BACK.: |
| 949 |
xtrabackup_copy_backcxx . . $ xtrabackup_copy_back. = TRUEcxx . . $ `include/my_global.h:476:9`!; |
| 950 |
xtrabackup_target_dircxx . . $ xtrabackup_target_dir. = ibx_position_argcxx . . $ ibx_position_arg.; |
| 951 |
run = "copy-back"; |
| 952 |
break; |
| 953 |
case IBX_MODE_MOVE_BACKcxx . . $ IBX_MODE_MOVE_BACK.: |
| 954 |
xtrabackup_move_backcxx . . $ xtrabackup_move_back. = TRUEcxx . . $ `include/my_global.h:476:9`!; |
| 955 |
xtrabackup_target_dircxx . . $ xtrabackup_target_dir. = ibx_position_argcxx . . $ ibx_position_arg.; |
| 956 |
run = "move-back"; |
| 957 |
break; |
| 958 |
case IBX_MODE_DECRYPT_DECOMPRESScxx . . $ IBX_MODE_DECRYPT_DECOMPRESS.: |
| 959 |
xtrabackup_decrypt_decompresscxx . . $ xtrabackup_decrypt_decompress. = TRUEcxx . . $ `include/my_global.h:476:9`!; |
| 960 |
xtrabackup_target_dircxx . . $ xtrabackup_target_dir. = ibx_position_argcxx . . $ ibx_position_arg.; |
| 961 |
run = "decompress"; |
| 962 |
break; |
| 963 |
default: |
| 964 |
ut_errorcxx . . $ `storage/innobase/include/ut0dbg.h:58:9`!; |
| 965 |
} |
| 966 |
|
| 967 |
ibx_msgcxx . . $ ibx_msg(581fddd72a8db8fc).("Starting the %s operation\n\n" |
| 968 |
"IMPORTANT: Please check that the %s run completes " |
| 969 |
"successfully.\n" |
| 970 |
" At the end of a successful %s run innobackupex\n" |
| 971 |
" prints \"completed OK!\".\n\n", run, run, run); |
| 972 |
|
| 973 |
|
| 974 |
return(true); |
| 975 |
} |
| 976 |
|
| 977 |
void |
| 978 |
ibx_cleanupcxx . . $ ibx_cleanup(49f6e7a06ebc5aa8).() |
| 979 |
{ |
| 980 |
free(ibx_backup_directorycxx . . $ ibx_backup_directory.); |
| 981 |
} |