Commit a78d5dd3 authored by Vlad Lesin's avatar Vlad Lesin

MDEV-18573: avoid backup inconsistency in 10.2

--no-lock and --lock-ddl-per-table options deprecared, the corresponing
code is removed.  aria_log_control is copied first and aria_log.# files last
under FTWRL.
parent 8a9cdc5f
......@@ -1325,7 +1325,7 @@ backup_files(const char *from, bool prep_mode)
}
msg("rsync finished successfully.");
if (!prep_mode && !opt_no_lock) {
if (!prep_mode) {
char path[FN_REFLEN];
char dst_path[FN_REFLEN];
char *newline;
......@@ -1406,24 +1406,22 @@ extern void backup_wait_for_lsn(lsn_t lsn);
/** Start --backup */
bool backup_start()
{
if (!opt_no_lock) {
if (opt_safe_slave_backup) {
if (!wait_for_safe_slave(mysql_connection)) {
return(false);
}
}
if (!backup_files(fil_path_to_mysql_datadir, true)) {
if (opt_safe_slave_backup) {
if (!wait_for_safe_slave(mysql_connection)) {
return(false);
}
}
if (!backup_files(fil_path_to_mysql_datadir, true)) {
return(false);
}
history_lock_time = time(NULL);
history_lock_time = time(NULL);
if (!lock_tables(mysql_connection)) {
return(false);
}
server_lsn_after_lock = get_current_lsn(mysql_connection);
if (!lock_tables(mysql_connection)) {
return(false);
}
server_lsn_after_lock = get_current_lsn(mysql_connection);
if (!backup_files(fil_path_to_mysql_datadir, false)) {
return(false);
......@@ -1441,17 +1439,6 @@ bool backup_start()
backup_wait_for_lsn(server_lsn_after_lock);
backup_fix_ddl();
// There is no need to stop slave thread before coping non-Innodb data when
// --no-lock option is used because --no-lock option requires that no DDL or
// DML to non-transaction tables can occur.
if (opt_no_lock) {
if (opt_safe_slave_backup) {
if (!wait_for_safe_slave(mysql_connection)) {
return(false);
}
}
}
if (opt_slave_info) {
lock_binlog_maybe(mysql_connection);
......@@ -1479,7 +1466,7 @@ bool backup_start()
write_binlog_info(mysql_connection);
}
if (have_flush_engine_logs && !opt_no_lock) {
if (have_flush_engine_logs) {
msg("Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...");
xb_mysql_query(mysql_connection,
"FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS", false);
......@@ -1492,16 +1479,8 @@ bool backup_start()
void backup_release()
{
/* release all locks */
if (!opt_no_lock) {
unlock_all(mysql_connection);
history_lock_time = 0;
} else {
history_lock_time = time(NULL) - history_lock_time;
}
if (opt_lock_ddl_per_table) {
mdl_unlock_all();
}
unlock_all(mysql_connection);
history_lock_time = 0;
if (opt_safe_slave_backup && sql_thread_started) {
msg("Starting slave SQL thread");
......@@ -2091,6 +2070,13 @@ decrypt_decompress()
*/
static bool backup_files_from_datadir(const char *dir_path)
{
std::string aria_ctrl_file(dir_path);
aria_ctrl_file.append("/aria_log_control");
if (file_exists(aria_ctrl_file.c_str()) &&
!copy_file(ds_data, aria_ctrl_file.c_str(), "aria_log_control", 1)) {
return false;
}
os_file_dir_t dir = os_file_opendir(dir_path, TRUE);
os_file_stat_t info;
bool ret = true;
......@@ -2104,7 +2090,7 @@ static bool backup_files_from_datadir(const char *dir_path)
pname = info.name;
/* Copy aria log files, and aws keys for encryption plugins.*/
const char *prefixes[] = { "aria_log", "aws-kms-key" };
const char *prefixes[] = { "aria_log.", "aws-kms-key" };
for (size_t i = 0; i < array_elements(prefixes); i++) {
if (starts_with(pname, prefixes[i])) {
ret = copy_file(ds_data, info.name, info.name, 1);
......
......@@ -867,83 +867,6 @@ stop_query_killer()
os_event_wait_time(kill_query_thread_stopped, 60000);
}
/*
Killing connections that wait for MDL lock.
If lock-ddl-per-table is used, there can be some DDL statements
FLUSH TABLES would hang infinitely, if DDL statements are waiting for
MDL lock, which mariabackup currently holds. Therefore we start killing
those statements from a dedicated thread, until FLUSH TABLES WITH READ LOCK
succeeds.
*/
static os_event_t mdl_killer_stop_event;
static os_event_t mdl_killer_finished_event;
static
os_thread_ret_t
DECLARE_THREAD(kill_mdl_waiters_thread(void *))
{
MYSQL *mysql;
if ((mysql = xb_mysql_connect()) == NULL) {
msg("Error: kill mdl waiters thread failed to connect");
goto stop_thread;
}
for(;;){
if (os_event_wait_time(mdl_killer_stop_event, 1000) == 0)
break;
MYSQL_RES *result = xb_mysql_query(mysql,
"SELECT ID, COMMAND, INFO FROM INFORMATION_SCHEMA.PROCESSLIST "
" WHERE State='Waiting for table metadata lock'",
true, true);
while (MYSQL_ROW row = mysql_fetch_row(result))
{
char query[64];
if (row[1] && !strcmp(row[1], "Killed"))
continue;
msg("Killing MDL waiting %s ('%s') on connection %s",
row[1], row[2], row[0]);
snprintf(query, sizeof(query), "KILL QUERY %s", row[0]);
if (mysql_query(mysql, query) && (mysql_errno(mysql) != ER_NO_SUCH_THREAD)) {
die("failed to execute query %s: %s", query,mysql_error(mysql));
}
}
mysql_free_result(result);
}
mysql_close(mysql);
stop_thread:
msg("Kill mdl waiters thread stopped");
os_event_set(mdl_killer_finished_event);
os_thread_exit();
return os_thread_ret_t(0);
}
static void start_mdl_waiters_killer()
{
mdl_killer_stop_event = os_event_create(0);
mdl_killer_finished_event = os_event_create(0);
os_thread_create(kill_mdl_waiters_thread, 0, 0);
}
/* Tell MDL killer to stop and finish for its completion*/
static void stop_mdl_waiters_killer()
{
os_event_set(mdl_killer_stop_event);
os_event_wait(mdl_killer_finished_event);
os_event_destroy(mdl_killer_stop_event);
os_event_destroy(mdl_killer_finished_event);
}
/*********************************************************************//**
Function acquires either a backup tables lock, if supported
by the server, or a global read lock (FLUSH TABLES WITH READ LOCK)
......@@ -966,10 +889,6 @@ lock_tables(MYSQL *connection)
return(true);
}
if (opt_lock_ddl_per_table) {
start_mdl_waiters_killer();
}
if (!opt_lock_wait_timeout && !opt_kill_long_queries_timeout) {
/* We do first a FLUSH TABLES. If a long update is running, the
......@@ -1009,11 +928,6 @@ lock_tables(MYSQL *connection)
}
xb_mysql_query(connection, "FLUSH TABLES WITH READ LOCK", false);
if (opt_lock_ddl_per_table) {
stop_mdl_waiters_killer();
}
if (opt_kill_long_queries_timeout) {
stop_query_killer();
}
......@@ -1029,7 +943,7 @@ not in the --no-lock mode and the lock has not been acquired already.
bool
lock_binlog_maybe(MYSQL *connection)
{
if (have_backup_locks && !opt_no_lock && !binlog_locked) {
if (have_backup_locks && !binlog_locked) {
msg("Executing LOCK BINLOG FOR BACKUP...");
xb_mysql_query(connection, "LOCK BINLOG FOR BACKUP", false);
binlog_locked = true;
......@@ -1779,37 +1693,3 @@ mdl_lock_init()
xb_mysql_query(mdl_con, "BEGIN", false, true);
}
void
mdl_lock_table(ulint space_id)
{
if (space_id == 0)
return;
std::string full_table_name = spaceid_to_tablename[space_id];
DBUG_EXECUTE_IF("rename_during_mdl_lock_table",
if (full_table_name == "`test`.`t1`")
xb_mysql_query(mysql_connection, "RENAME TABLE test.t1 to test.t2", false, true);
);
std::ostringstream lock_query;
lock_query << "SELECT 1 FROM " << full_table_name << " LIMIT 0";
msg("Locking MDL for %s", full_table_name.c_str());
if (mysql_query(mdl_con, lock_query.str().c_str())) {
msg("Warning : locking MDL failed for space id %zu, name %s", space_id, full_table_name.c_str());
} else {
MYSQL_RES *r = mysql_store_result(mdl_con);
mysql_free_result(r);
}
}
void
mdl_unlock_all()
{
msg("Unlocking MDL for all tables");
xb_mysql_query(mdl_con, "COMMIT", false, true);
mysql_close(mdl_con);
spaceid_to_tablename.clear();
}
......@@ -76,7 +76,7 @@ my_bool opt_ibx_copy_back = FALSE;
my_bool opt_ibx_move_back = FALSE;
my_bool opt_ibx_galera_info = FALSE;
my_bool opt_ibx_slave_info = FALSE;
my_bool opt_ibx_no_lock = FALSE;
my_bool opt_ibx_no_lock_deprecated = FALSE;
my_bool opt_ibx_safe_slave_backup = FALSE;
my_bool opt_ibx_rsync = FALSE;
my_bool opt_ibx_force_non_empty_dirs = FALSE;
......@@ -266,21 +266,9 @@ static struct my_option ibx_long_options[] =
(uchar *) &opt_ibx_incremental, (uchar *) &opt_ibx_incremental, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-lock", OPT_NO_LOCK, "Use this option to disable table lock "
"with \"FLUSH TABLES WITH READ LOCK\". Use it only if ALL your "
"tables are InnoDB and you DO NOT CARE about the binary log "
"position of the backup. This option shouldn't be used if there "
"are any DDL statements being executed or if any updates are "
"happening on non-InnoDB tables (this includes the system MyISAM "
"tables in the mysql database), otherwise it could lead to an "
"inconsistent backup. If you are considering to use --no-lock "
"because your backups are failing to acquire the lock, this could "
"be because of incoming replication events preventing the lock "
"from succeeding. Please try using --safe-slave-backup to "
"momentarily stop the replication slave thread, this may help "
"the backup to succeed and you then don't need to resort to "
"using this option.",
(uchar *) &opt_ibx_no_lock, (uchar *) &opt_ibx_no_lock, 0,
{"no-lock", OPT_NO_LOCK, "Deprecated option.",
(uchar *) &opt_ibx_no_lock_deprecated,
(uchar *) &opt_ibx_no_lock_deprecated, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"safe-slave-backup", OPT_SAFE_SLAVE_BACKUP, "Stop slave SQL thread "
......@@ -782,6 +770,9 @@ ibx_get_one_option(int optid,
start[1]=0 ;
}
break;
case OPT_NO_LOCK:
die("option --no-lock is deprecated");
break;
}
return(0);
}
......@@ -878,7 +869,6 @@ ibx_init()
xtrabackup_move_back = opt_ibx_move_back;
opt_galera_info = opt_ibx_galera_info;
opt_slave_info = opt_ibx_slave_info;
opt_no_lock = opt_ibx_no_lock;
opt_safe_slave_backup = opt_ibx_safe_slave_backup;
opt_rsync = opt_ibx_rsync;
opt_force_non_empty_dirs = opt_ibx_force_non_empty_dirs;
......
......@@ -295,7 +295,7 @@ extern LOGGER logger;
my_bool opt_galera_info = FALSE;
my_bool opt_slave_info = FALSE;
my_bool opt_no_lock = FALSE;
my_bool opt_no_lock_deprecated = FALSE;
my_bool opt_safe_slave_backup = FALSE;
my_bool opt_rsync = FALSE;
my_bool opt_force_non_empty_dirs = FALSE;
......@@ -304,7 +304,7 @@ my_bool opt_no_backup_locks = FALSE;
my_bool opt_decompress = FALSE;
my_bool opt_remove_original;
my_bool opt_lock_ddl_per_table = FALSE;
my_bool opt_lock_ddl_per_table_deprecated = FALSE;
static my_bool opt_check_privileges;
static const char *binlog_info_values[] = {"off", "lockless", "on", "auto",
......@@ -499,6 +499,9 @@ Execute query from a new connection, in own thread.
@param expected_errno - if not 0, and query finished with error,
expected mysql_errno()
*/
// TODO: remove "unused" attribute when use it, the function can be used in
// the future for debug and testing
__attribute__((unused))
static os_event_t dbug_start_query_thread(
const char *query,
const char *wait_state,
......@@ -543,24 +546,6 @@ static os_event_t dbug_start_query_thread(
os_event_t dbug_alter_thread_done;
#endif
void mdl_lock_all()
{
mdl_lock_init();
datafiles_iter_t *it = datafiles_iter_new(fil_system);
if (!it)
return;
while (fil_node_t *node = datafiles_iter_next(it)){
if (fil_is_user_tablespace_id(node->space->id)
&& check_if_skip_table(node->space->name))
continue;
mdl_lock_table(node->space->id);
}
datafiles_iter_free(it);
}
// Convert non-null terminated filename to space name
std::string filename_to_spacename(const byte *filename, size_t len)
{
......@@ -625,8 +610,7 @@ static void backup_file_op(ulint space_id, const byte* flags,
This callback is called if DDL operation is detected,
at the end of backup
Normally, DDL operations are blocked due to FTWRL,
but in rare cases of --no-lock, they are not.
Normally, DDL operations are blocked due to FTWRL.
We will abort backup in this case.
*/
......@@ -634,30 +618,8 @@ static void backup_file_op_fail(ulint space_id, const byte* flags,
const byte* name, ulint len,
const byte* new_name, ulint new_len)
{
ut_a(opt_no_lock);
bool fail;
if (flags) {
msg("DDL tracking : create %zu \"%.*s\": %x",
space_id, int(len), name, mach_read_from_4(flags));
std::string spacename = filename_to_spacename(name, len);
fail = !check_if_skip_table(spacename.c_str());
}
else if (new_name) {
msg("DDL tracking : rename %zu \"%.*s\",\"%.*s\"",
space_id, int(len), name, int(new_len), new_name);
std::string spacename = filename_to_spacename(name, len);
std::string new_spacename = filename_to_spacename(new_name, new_len);
fail = !check_if_skip_table(spacename.c_str()) || !check_if_skip_table(new_spacename.c_str());
}
else {
std::string spacename = filename_to_spacename(name, len);
fail = !check_if_skip_table(spacename.c_str());
msg("DDL tracking : delete %zu \"%.*s\"", space_id, int(len), name);
}
if (fail) {
die("DDL operation detected in the late phase of backup."
"Backup is inconsistent. Remove --no-lock option to fix.");
}
die("DDL operation detected in the late phase of backup."
"Backup is inconsistent.");
}
......@@ -675,23 +637,15 @@ static void backup_optimized_ddl_op(ulint space_id)
run with --no-lock. Usually aborts the backup.
*/
static void backup_optimized_ddl_op_fail(ulint space_id) {
ut_a(opt_no_lock);
msg("DDL tracking : optimized DDL on space %zu", space_id);
if (ddl_tracker.tables_in_backup.find(space_id) != ddl_tracker.tables_in_backup.end()) {
msg("ERROR : Optimized DDL operation detected in the late phase of backup."
"Backup is inconsistent. Remove --no-lock option to fix.");
exit(EXIT_FAILURE);
}
die("ERROR : Optimized DDL operation detected in the late phase of backup."
"Backup is inconsistent.");
}
/** Callback whenever MLOG_TRUNCATE happens. */
static void backup_truncate_fail()
{
msg("mariabackup: Incompatible TRUNCATE operation detected.%s",
opt_lock_ddl_per_table
? ""
: " Use --lock-ddl-per-table to lock all tables before backup.");
msg("mariabackup: Incompatible TRUNCATE operation detected.");
}
......@@ -981,21 +935,8 @@ struct my_option xb_client_options[] =
(uchar *) &opt_slave_info, (uchar *) &opt_slave_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-lock", OPT_NO_LOCK, "Use this option to disable table lock "
"with \"FLUSH TABLES WITH READ LOCK\". Use it only if ALL your "
"tables are InnoDB and you DO NOT CARE about the binary log "
"position of the backup. This option shouldn't be used if there "
"are any DDL statements being executed or if any updates are "
"happening on non-InnoDB tables (this includes the system MyISAM "
"tables in the mysql database), otherwise it could lead to an "
"inconsistent backup. If you are considering to use --no-lock "
"because your backups are failing to acquire the lock, this could "
"be because of incoming replication events preventing the lock "
"from succeeding. Please try using --safe-slave-backup to "
"momentarily stop the replication slave thread, this may help "
"the backup to succeed and you then don't need to resort to "
"using this option.",
(uchar *) &opt_no_lock, (uchar *) &opt_no_lock, 0,
{"no-lock", OPT_NO_LOCK, "Deprecated option",
(uchar *) &opt_no_lock_deprecated, (uchar *) &opt_no_lock_deprecated, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"safe-slave-backup", OPT_SAFE_SLAVE_BACKUP, "Stop slave SQL thread "
......@@ -1390,9 +1331,9 @@ struct my_option xb_server_options[] =
(G_PTR*) &xb_open_files_limit, (G_PTR*) &xb_open_files_limit, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0},
{"lock-ddl-per-table", OPT_LOCK_DDL_PER_TABLE, "Lock DDL for each table "
"before xtrabackup starts to copy it and until the backup is completed.",
(uchar*) &opt_lock_ddl_per_table, (uchar*) &opt_lock_ddl_per_table, 0,
{"lock-ddl-per-table", OPT_LOCK_DDL_PER_TABLE, "Deprecated option",
(uchar*) &opt_lock_ddl_per_table_deprecated,
(uchar*) &opt_lock_ddl_per_table_deprecated, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"rocksdb-datadir", OPT_ROCKSDB_DATADIR, "RocksDB data directory."
......@@ -1783,6 +1724,12 @@ xb_get_one_option(int optid,
print_version();
exit(EXIT_SUCCESS);
break;
case OPT_NO_LOCK:
die("Deprecated option --no-lock");
break;
case OPT_LOCK_DDL_PER_TABLE:
die("Deprecated option --lock-ddl-per-table");
break;
default:
break;
}
......@@ -4307,15 +4254,6 @@ xtrabackup_backup_func()
"files transfer", xtrabackup_parallel);
}
if (opt_lock_ddl_per_table) {
mdl_lock_all();
DBUG_EXECUTE_IF("check_mdl_lock_works",
dbug_alter_thread_done =
dbug_start_query_thread("ALTER TABLE test.t ADD COLUMN mdl_lock_column int",
"Waiting for table metadata lock", 1, ER_QUERY_INTERRUPTED););
}
datafiles_iter_t *it = datafiles_iter_new(fil_system);
if (it == NULL) {
msg("mariabackup: Error: datafiles_iter_new() failed.");
......@@ -5825,22 +5763,16 @@ check_all_privileges()
int check_result = PRIVILEGE_OK;
/* FLUSH TABLES WITH READ LOCK */
if (!opt_no_lock)
{
check_result |= check_privilege(
granted_privileges,
"RELOAD", "*", "*");
}
check_result |= check_privilege(
granted_privileges,
"RELOAD", "*", "*");
if (!opt_no_lock)
{
check_result |= check_privilege(
granted_privileges,
"PROCESS", "*", "*");
}
check_result |= check_privilege(
granted_privileges,
"PROCESS", "*", "*");
/* KILL ... */
if ((!opt_no_lock && (opt_kill_long_queries_timeout || opt_lock_ddl_per_table))
if (opt_kill_long_queries_timeout
/* START SLAVE SQL_THREAD */
/* STOP SLAVE SQL_THREAD */
|| opt_safe_slave_backup) {
......@@ -5852,8 +5784,7 @@ check_all_privileges()
/* SHOW MASTER STATUS */
/* SHOW SLAVE STATUS */
if (opt_galera_info || opt_slave_info
|| (opt_no_lock && opt_safe_slave_backup)) {
if (opt_galera_info || opt_slave_info) {
check_result |= check_privilege(granted_privileges,
"REPLICATION CLIENT", "*", "*",
PRIVILEGE_WARNING);
......@@ -5873,15 +5804,6 @@ xb_init()
/* sanity checks */
if (opt_slave_info
&& opt_no_lock
&& !opt_safe_slave_backup) {
msg("Error: --slave-info is used with --no-lock but "
"without --safe-slave-backup. The binlog position "
"cannot be consistent with the backup data.");
return(false);
}
if (xtrabackup_backup && opt_rsync)
{
if (xtrabackup_stream_fmt)
......
......@@ -99,7 +99,6 @@ extern longlong xtrabackup_use_memory;
extern my_bool opt_galera_info;
extern my_bool opt_slave_info;
extern my_bool opt_no_lock;
extern my_bool opt_safe_slave_backup;
extern my_bool opt_rsync;
extern my_bool opt_force_non_empty_dirs;
......@@ -109,7 +108,6 @@ extern my_bool opt_decompress;
extern my_bool opt_remove_original;
extern my_bool opt_extended_validation;
extern my_bool opt_encrypted_backup;
extern my_bool opt_lock_ddl_per_table;
extern char *opt_incremental_history_name;
extern char *opt_incremental_history_uuid;
......
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
CREATE user backup@localhost;
# backup possible for unprivileges user, with --no-lock
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup --no-lock --target-dir=$targetdir;
--enable_result_log
rmdir $targetdir;
# backup fails without --no-lock, because of FTWRL
--disable_result_log
error 1;
......
--source include/have_debug.inc
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
mkdir $targetdir;
CREATE TABLE t1(i int) ENGINE=INNODB;
# this will table and populate it, after backup has list of tables to be copied
--let backup_fix_ddl=BEGIN NOT ATOMIC DROP TABLE test.t1;DO SLEEP(10000); END
echo # xtrabackup backup;
--disable_result_log
error 1;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --no-lock --dbug=+d,mariabackup_events;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --no-lock;
error 1;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --lock-ddl-per-table;
--enable_result_log
rmdir $targetdir;
--source include/have_debug.inc
--source include/have_partition.inc
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
echo # xtrabackup backup;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
CREATE TABLE `bobby``tables` (id INT, name VARCHAR(50), purchased DATE) ENGINE INNODB PARTITION BY RANGE( YEAR(purchased) ) (
PARTITION p0 VALUES LESS THAN (1990),
PARTITION p1 VALUES LESS THAN (1995),
PARTITION p2 VALUES LESS THAN (2000),
PARTITION p3 VALUES LESS THAN (2005)
) ;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --lock-ddl-per-table=1 --dbug=+d,check_mdl_lock_works;
--enable_result_log
DROP TABLE t;
DROP TABLE `bobby``tables`;
rmdir $targetdir;
\ No newline at end of file
--source include/have_debug.inc
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
mkdir $targetdir;
CREATE TABLE t1(i int) ENGINE INNODB;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --lock-ddl-per-table --dbug=+d,rename_during_mdl_lock_table;
echo # xtrabackup prepare;
--disable_result_log
exec $XTRABACKUP --prepare --target-dir=$targetdir;
-- source include/restart_and_restore.inc
--enable_result_log
# the table was renamed from t1 to t2
# make sure t1 does not exist, and t2 does
CREATE TABLE t1(i int);
DROP TABLE t1;
SELECT * from t2;
DROP TABLE t2;
rmdir $targetdir;
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