mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
f778a5d5e2
In commit 1c5ae99194
(MDEV-25666)
we had changed Mariabackup so that it would no longer skip files
whose names start with #sql. This turned out to be wrong.
Because operations on such named files are not protected by any
locks in the server, it is not safe to copy them.
Not copying the files may make the InnoDB data dictionary
inconsistent with the file system. So, we must do something
in InnoDB to adjust for that.
If InnoDB is being started up without the redo log (ib_logfile0)
or with a zero-length log file, we will assume that the server
was restored from a backup, and adjust things as follows:
dict_check_sys_tables(), fil_ibd_open(): Do not complain about
missing #sql files if they would be dropped a little later.
dict_stats_update_if_needed(): Never add #sql tables to
the recomputing queue. This avoids a potential race condition when
dropping the garbage tables.
drop_garbage_tables_after_restore(): Try to drop any garbage tables.
innodb_ddl_recovery_done(): Invoke drop_garbage_tables_after_restore()
if srv_start_after_restore (a new flag) was set and we are not in
read-only mode (innodb_read_only=ON or innodb_force_recovery>3).
The tests and dbug_mariabackup_event() instrumentation
were developed by Vladislav Vaintroub, who also reviewed this.
24 lines
749 B
Text
24 lines
749 B
Text
# xtrabackup backup
|
|
CREATE TABLE t1(i int) ENGINE=InnoDB;
|
|
INSERT into t1 values(1);
|
|
connect con2, localhost, root,,;
|
|
connection con2;
|
|
set lock_wait_timeout=1;
|
|
SET debug_sync='copy_data_between_tables_before_reset_backup_lock SIGNAL go WAIT_FOR after_backup_stage_block_commit';
|
|
SET debug_sync='alter_table_after_temp_table_drop SIGNAL temp_table_dropped';
|
|
SET debug_sync='now WAIT_FOR after_backup_stage_start';ALTER TABLE test.t1 FORCE, algorithm=COPY;|
|
|
connection default;
|
|
connection con2;
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
SET debug_sync='RESET';
|
|
disconnect con2;
|
|
connection default;
|
|
# xtrabackup prepare
|
|
# shutdown server
|
|
# remove datadir
|
|
# xtrabackup move back
|
|
# restart
|
|
SELECT * FROM t1;
|
|
i
|
|
1
|
|
DROP TABLE t1;
|