xtrabackup --defaults-file=/home/my3306/my.cnf -ubackupuser -p’backupser#123’ --socket=/home/my3306/run/mysql.sock --backup --target-dir=/home/backup/backupdir/base
xtrabackup --prepare --apply-log-only --target-dir=/home/backup/backupdir/base
2023-02-21T00:28:42.856846+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --innodb_checksum_algorithm=none --innodb_log_checksums=1 --innodb_data_file_path=ibdata1:1G;ibdata2:32M:autoextend --innodb_page_size=16384 --innodb_undo_directory=./ --innodb_undo_tablespaces=2 --server-id=3648 --innodb_log_checksums=ON --innodb_redo_log_encrypt=0 --innodb_undo_log_encrypt=0
2023-02-21T00:28:42.856941+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --prepare=1 --apply-log-only=1 --target-dir=/home/backup/backupdir/base
xtrabackup version 8.0.31-24 based on MySQL server 8.0.31 Linux (x86_64) (revision id: f0754edb)
2023-02-21T00:28:42.856967+08:00 0 [Note] [MY-011825] [Xtrabackup] cd to /home/backup/backupdir/base/
2023-02-21T00:28:42.857009+08:00 0 [Note] [MY-011825] [Xtrabackup] This target seems to be not prepared yet.
2023-02-21T00:28:42.863737+08:00 0 [Note] [MY-011825] [Xtrabackup] xtrabackup_logfile detected: size=8388608, start_lsn=(20536456)
2023-02-21T00:28:42.864206+08:00 0 [Note] [MY-011825] [Xtrabackup] using the following InnoDB configuration for recovery:
2023-02-21T00:28:42.864231+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_home_dir = .
2023-02-21T00:28:42.864244+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_file_path = ibdata1:1G;ibdata2:32M:autoextend
2023-02-21T00:28:42.864289+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_group_home_dir = .
2023-02-21T00:28:42.864300+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_files_in_group = 1
2023-02-21T00:28:42.864315+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_file_size = 8388608
2023-02-21T00:28:42.864527+08:00 0 [Note] [MY-011825] [Xtrabackup] inititialize_service_handles suceeded
2023-02-21T00:28:42.864684+08:00 0 [Note] [MY-011825] [Xtrabackup] using the following InnoDB configuration for recovery:
2023-02-21T00:28:42.864710+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_home_dir = .
2023-02-21T00:28:42.864716+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_file_path = ibdata1:1G;ibdata2:32M:autoextend
2023-02-21T00:28:42.864735+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_group_home_dir = .
2023-02-21T00:28:42.864745+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_files_in_group = 1
2023-02-21T00:28:42.864750+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_file_size = 8388608
2023-02-21T00:28:42.864760+08:00 0 [Note] [MY-011825] [Xtrabackup] Starting InnoDB instance for recovery.
2023-02-21T00:28:42.864769+08:00 0 [Note] [MY-011825] [Xtrabackup] Using 104857600 bytes for buffer pool (set by --use-memory parameter)
2023-02-21T00:28:42.864803+08:00 0 [Note] [MY-012932] [InnoDB] PUNCH HOLE support available
2023-02-21T00:28:42.864819+08:00 0 [Note] [MY-012944] [InnoDB] Uses event mutexes
2023-02-21T00:28:42.864825+08:00 0 [Note] [MY-012945] [InnoDB] GCC builtin __atomic_thread_fence() is used for memory barrier
2023-02-21T00:28:42.864839+08:00 0 [Note] [MY-012948] [InnoDB] Compressed tables use zlib 1.2.12
2023-02-21T00:28:42.865024+08:00 0 [Note] [MY-012951] [InnoDB] Using hardware accelerated crc32 and polynomial multiplication.
2023-02-21T00:28:42.865336+08:00 0 [Note] [MY-012203] [InnoDB] Directories to scan ‘./’
2023-02-21T00:28:42.865366+08:00 0 [Note] [MY-012204] [InnoDB] Scanning ‘./’
2023-02-21T00:28:42.866978+08:00 0 [Note] [MY-012208] [InnoDB] Completed space ID check of 9 files.
2023-02-21T00:28:42.867386+08:00 0 [Note] [MY-012955] [InnoDB] Initializing buffer pool, total size = 128.000000M, instances = 1, chunk size =128.000000M
2023-02-21T00:28:42.874734+08:00 0 [Note] [MY-012957] [InnoDB] Completed initialization of buffer pool
2023-02-21T00:28:42.877314+08:00 0 [Note] [MY-011952] [InnoDB] If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-02-21T00:28:42.961091+08:00 0 [Note] [MY-013883] [InnoDB] The latest found checkpoint is at lsn = 20536456 in redo log file ./#innodb_redo /#ib_redo0 .
2023-02-21T00:28:42.961152+08:00 0 [Note] [MY-012560] [InnoDB] The log sequence number 19656859 in the system tablespace does not match the log sequence number 20536456 in the redo log files!
2023-02-21T00:28:42.961165+08:00 0 [Note] [MY-012551] [InnoDB] Database was not shutdown normally!
2023-02-21T00:28:42.961174+08:00 0 [Note] [MY-012552] [InnoDB] Starting crash recovery.
2023-02-21T00:28:42.961288+08:00 0 [Note] [MY-013086] [InnoDB] Starting to parse redo log at lsn = 20536342, whereas checkpoint_lsn = 20536456 and start_lsn = 20536320
2023-02-21T00:28:42.961315+08:00 0 [Note] [MY-012550] [InnoDB] Doing recovery: scanned up to log sequence number 20536456
2023-02-21T00:28:42.972378+08:00 0 [Note] [MY-013083] [InnoDB] Log background threads are being started…
2023-02-21T00:28:42.973112+08:00 0 [Note] [MY-012532] [InnoDB] Applying a batch of 0 redo log records …
2023-02-21T00:28:42.973136+08:00 0 [Note] [MY-012535] [InnoDB] Apply batch completed!
2023-02-21T00:28:43.073333+08:00 0 [Note] [MY-013252] [InnoDB] Using undo tablespace ‘./undo_001’.
2023-02-21T00:28:43.073772+08:00 0 [Note] [MY-013252] [InnoDB] Using undo tablespace ‘./undo_002’.
2023-02-21T00:28:43.074510+08:00 0 [Note] [MY-012910] [InnoDB] Opened 2 existing undo tablespaces.
2023-02-21T00:28:43.074562+08:00 0 [Note] [MY-011980] [InnoDB] GTID recovery trx_no: 2853
2023-02-21T00:28:43.140002+08:00 0 [Note] [MY-013776] [InnoDB] Parallel initialization of rseg complete
2023-02-21T00:28:43.140044+08:00 0 [Note] [MY-013777] [InnoDB] Time taken to initialize rseg using 4 thread: 65484 ms.
2023-02-21T00:28:43.140105+08:00 0 [Note] [MY-012923] [InnoDB] Creating shared tablespace for temporary tables
2023-02-21T00:28:43.140156+08:00 0 [Note] [MY-012265] [InnoDB] Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2023-02-21T00:28:43.165639+08:00 0 [Note] [MY-012266] [InnoDB] File ‘./ibtmp1’ size is now 12 MB.
2023-02-21T00:28:43.165782+08:00 0 [Note] [MY-013627] [InnoDB] Scanning temp tablespace dir:‘./#innodb_temp /’
2023-02-21T00:28:43.175421+08:00 0 [Note] [MY-013018] [InnoDB] Created 128 and tracked 128 new rollback segment(s) in the temporary tablespace. 128 are now active.
2023-02-21T00:28:43.175605+08:00 0 [Note] [MY-012976] [InnoDB] 8.0.31 started; log sequence number 20536466
2023-02-21T00:28:43.175981+08:00 0 [Warning] [MY-012091] [InnoDB] Allocated tablespace ID 1 for sys/sys_config, old maximum was 0
2023-02-21T00:28:43.206337+08:00 0 [Note] [MY-011825] [Xtrabackup] starting shutdown with innodb_fast_shutdown = 1
2023-02-21T00:28:43.206420+08:00 0 [Note] [MY-012330] [InnoDB] FTS optimize thread exiting.
2023-02-21T00:28:44.206275+08:00 0 [Note] [MY-013072] [InnoDB] Starting shutdown…
2023-02-21T00:28:44.210134+08:00 0 [Note] [MY-013084] [InnoDB] Log background threads are being closed…
2023-02-21T00:28:44.222000+08:00 0 [Note] [MY-012980] [InnoDB] Shutdown completed; log sequence number 20536466
2023-02-21T00:28:44.224233+08:00 0 [Note] [MY-011825] [Xtrabackup] completed OK!
the message “Database was not shutdown normally!” explain the apply-log-only is ignored ? how to deal with it. thanks.
Pep_Pla
February 20, 2023, 5:08pm
2
Hi @SunCheng
Thank you for being an active member of our community.
Not sure if I understood your problem. The “Database was not shutdown normally” is a standard message during the prepare
stage. It is not an error. It is just informative.
Are you restoring incremental backups? If you are not, you should not use the --apply-only option
.
Thanks
Pep
i will do incremental restore.
xtrabackup --defaults-file=/home/my3306/my.cnf -ubackupuser -p’backupser#123’ --socket=/home/my3306/run/mysql.sock --backup --target-dir=/home/backup/backupdir/inc1 --incremental-basedir=/home/backup/backupdir/base
xtrabackup --prepare --target-dir=/home/backup/backupdir/base --incremental-basedir=/home/backup/backupdir/inc1
after i did the full-backup with --prepare andn --apply-log-only. then incremental resotre --prepare . the lsn not equal to xtrabackup_checkpoints’s to_lsn . it’s report "xtrabackup_logfile was already used to ‘–prepare’. " so i assume that the full-backup --apply-log-only is not work.
xtrabackup --prepare --target-dir=/home/backup/backupdir/base --incremental-basedir=/home/backup/backupdir/inc1
2023-02-21T08:42:48.867873+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --innodb_checksum_algorithm=none --innodb_log_checksums=1 --innodb_data_file_path=ibdata1:1G;ibdata2:32M:autoextend --innodb_page_size=16384 --innodb_undo_directory=./ --innodb_undo_tablespaces=2 --server-id=3648 --innodb_log_checksums=ON --innodb_redo_log_encrypt=0 --innodb_undo_log_encrypt=0
2023-02-21T08:42:48.867978+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --prepare=1 --target-dir=/home/backup/backupdir/base --incremental-basedir=/home/backup/backupdir/inc1
xtrabackup version 8.0.31-24 based on MySQL server 8.0.31 Linux (x86_64) (revision id: f0754edb)
2023-02-21T08:42:48.868005+08:00 0 [Note] [MY-011825] [Xtrabackup] cd to /home/backup/backupdir/base/
2023-02-21T08:42:48.868059+08:00 0 [Note] [MY-011825] [Xtrabackup] This target seems to be already prepared with --apply-log-only.
2023-02-21T08:42:48.868646+08:00 0 [Note] [MY-011825] [Xtrabackup] xtrabackup_logfile was already used to ‘–prepare’.
2023-02-21T08:42:48.868994+08:00 0 [Note] [MY-011825] [Xtrabackup] using the following InnoDB configuration for recovery:
2023-02-21T08:42:48.869015+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_home_dir = .
2023-02-21T08:42:48.869028+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_file_path = ibdata1:1G;ibdata2:32M:autoextend
2023-02-21T08:42:48.869090+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_group_home_dir = .
2023-02-21T08:42:48.869103+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_files_in_group = 2
2023-02-21T08:42:48.869115+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_file_size = 50331648
2023-02-21T08:42:48.869332+08:00 0 [Note] [MY-011825] [Xtrabackup] inititialize_service_handles suceeded
2023-02-21T08:42:48.869509+08:00 0 [Note] [MY-011825] [Xtrabackup] using the following InnoDB configuration for recovery:
2023-02-21T08:42:48.869527+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_home_dir = .
2023-02-21T08:42:48.869533+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_file_path = ibdata1:1G;ibdata2:32M:autoextend
2023-02-21T08:42:48.869551+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_group_home_dir = .
2023-02-21T08:42:48.869559+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_files_in_group = 2
2023-02-21T08:42:48.869581+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_file_size = 50331648
2023-02-21T08:42:48.869589+08:00 0 [Note] [MY-011825] [Xtrabackup] Starting InnoDB instance for recovery.
2023-02-21T08:42:48.869597+08:00 0 [Note] [MY-011825] [Xtrabackup] Using 104857600 bytes for buffer pool (set by --use-memory parameter)
2023-02-21T08:42:48.869635+08:00 0 [Note] [MY-012932] [InnoDB] PUNCH HOLE support available
2023-02-21T08:42:48.869654+08:00 0 [Note] [MY-012944] [InnoDB] Uses event mutexes
2023-02-21T08:42:48.869665+08:00 0 [Note] [MY-012945] [InnoDB] GCC builtin __atomic_thread_fence() is used for memory barrier
2023-02-21T08:42:48.869686+08:00 0 [Note] [MY-012948] [InnoDB] Compressed tables use zlib 1.2.12
2023-02-21T08:42:48.869873+08:00 0 [Note] [MY-012951] [InnoDB] Using hardware accelerated crc32 and polynomial multiplication.
2023-02-21T08:42:48.870218+08:00 0 [Note] [MY-012203] [InnoDB] Directories to scan ‘./’
2023-02-21T08:42:48.870250+08:00 0 [Note] [MY-012204] [InnoDB] Scanning ‘./’
2023-02-21T08:42:48.870841+08:00 0 [Note] [MY-012208] [InnoDB] Completed space ID check of 9 files.
2023-02-21T08:42:48.871288+08:00 0 [Note] [MY-012955] [InnoDB] Initializing buffer pool, total size = 128.000000M, instances = 1, chunk size =128.000000M
2023-02-21T08:42:48.878351+08:00 0 [Note] [MY-012957] [InnoDB] Completed initialization of buffer pool
2023-02-21T08:42:48.880727+08:00 0 [Note] [MY-011952] [InnoDB] If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-02-21T08:42:48.950195+08:00 0 [Note] [MY-011825] [InnoDB] Creating redo log file at ./#innodb_redo /#ib_redo0_tmp with file_id 0 with size 33554432 bytes
2023-02-21T08:42:48.951734+08:00 0 [Note] [MY-011825] [InnoDB] Renaming redo log file from ./#innodb_redo /#ib_redo0_tmp to ./#innodb_redo /#ib_redo0
2023-02-21T08:42:48.952582+08:00 0 [Note] [MY-012893] [InnoDB] New redo log files created, LSN=20536466
2023-02-21T08:42:48.953208+08:00 0 [Note] [MY-013883] [InnoDB] The latest found checkpoint is at lsn = 20536844 in redo log file ./#innodb_redo /#ib_redo0 .
2023-02-21T08:42:48.953314+08:00 0 [Note] [MY-013086] [InnoDB] Starting to parse redo log at lsn = 20536844, whereas checkpoint_lsn = 20536844 and start_lsn = 20536832
2023-02-21T08:42:48.954525+08:00 0 [Note] [MY-013083] [InnoDB] Log background threads are being started…
2023-02-21T08:42:48.955288+08:00 0 [Note] [MY-012532] [InnoDB] Applying a batch of 0 redo log records …
2023-02-21T08:42:48.955315+08:00 0 [Note] [MY-012535] [InnoDB] Apply batch completed!
2023-02-21T08:42:48.955466+08:00 0 [Note] [MY-013084] [InnoDB] Log background threads are being closed…
2023-02-21T08:42:48.956831+08:00 0 [Note] [MY-013041] [InnoDB] Resizing redo log from 32M to 1024M (LSN=20536844) synchronously. If this takes too long, consider starting the server with large --innodb_redo_log_capacity, and resizing the redo log online using SET.
2023-02-21T08:42:48.957760+08:00 0 [Note] [MY-012968] [InnoDB] Starting to delete and rewrite redo log files.
2023-02-21T08:42:48.957807+08:00 0 [Note] [MY-011825] [InnoDB] Removing redo log file: ./#innodb_redo /#ib_redo0
2023-02-21T08:42:49.029516+08:00 0 [Note] [MY-011825] [InnoDB] Creating redo log file at ./#innodb_redo /#ib_redo0_tmp with file_id 0 with size 33554432 bytes
2023-02-21T08:42:49.031153+08:00 0 [Note] [MY-011825] [InnoDB] Renaming redo log file from ./#innodb_redo /#ib_redo0_tmp to ./#innodb_redo /#ib_redo0
2023-02-21T08:42:49.031873+08:00 0 [Note] [MY-012893] [InnoDB] New redo log files created, LSN=20537356
2023-02-21T08:42:49.031920+08:00 0 [Note] [MY-013083] [InnoDB] Log background threads are being started…
2023-02-21T08:42:49.032681+08:00 0 [Note] [MY-013252] [InnoDB] Using undo tablespace ‘./undo_001’.
2023-02-21T08:42:49.049421+08:00 0 [Note] [MY-013252] [InnoDB] Using undo tablespace ‘./undo_002’.
2023-02-21T08:42:49.062610+08:00 0 [Note] [MY-012910] [InnoDB] Opened 2 existing undo tablespaces.
2023-02-21T08:42:49.062668+08:00 0 [Note] [MY-011980] [InnoDB] GTID recovery trx_no: 2853
2023-02-21T08:42:49.067429+08:00 0 [Note] [MY-013776] [InnoDB] Parallel initialization of rseg complete
2023-02-21T08:42:49.067466+08:00 0 [Note] [MY-013777] [InnoDB] Time taken to initialize rseg using 4 thread: 4805 ms.
2023-02-21T08:42:49.068477+08:00 0 [Note] [MY-012255] [InnoDB] Removed temporary tablespace data file: “ibtmp1”
2023-02-21T08:42:49.068501+08:00 0 [Note] [MY-012923] [InnoDB] Creating shared tablespace for temporary tables
2023-02-21T08:42:49.068538+08:00 0 [Note] [MY-012265] [InnoDB] Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2023-02-21T08:42:49.086854+08:00 0 [Note] [MY-012266] [InnoDB] File ‘./ibtmp1’ size is now 12 MB.
2023-02-21T08:42:49.086989+08:00 0 [Note] [MY-013627] [InnoDB] Scanning temp tablespace dir:‘./#innodb_temp /’
2023-02-21T08:42:49.096344+08:00 0 [Note] [MY-013018] [InnoDB] Created 128 and tracked 128 new rollback segment(s) in the temporary tablespace. 128 are now active.
2023-02-21T08:42:49.096530+08:00 0 [Note] [MY-012976] [InnoDB] 8.0.31 started; log sequence number 20537366
2023-02-21T08:42:49.108635+08:00 0 [Warning] [MY-012091] [InnoDB] Allocated tablespace ID 1 for sys/sys_config, old maximum was 0
2023-02-21T08:42:49.178479+08:00 0 [Note] [MY-011825] [Xtrabackup] starting shutdown with innodb_fast_shutdown = 1
2023-02-21T08:42:49.178541+08:00 0 [Note] [MY-012330] [InnoDB] FTS optimize thread exiting.
2023-02-21T08:42:50.178441+08:00 0 [Note] [MY-013072] [InnoDB] Starting shutdown…
2023-02-21T08:42:50.182401+08:00 0 [Note] [MY-013084] [InnoDB] Log background threads are being closed…
2023-02-21T08:42:50.195789+08:00 0 [Note] [MY-012980] [InnoDB] Shutdown completed; log sequence number 20537366
2023-02-21T08:42:50.198121+08:00 0 [Note] [MY-011825] [Xtrabackup] completed OK!
Pep_Pla
February 21, 2023, 7:07am
5
Hi @SunCheng
Could you post the exact steps that you followed?
Please, do not post full logs, if you feel that they are required, edit them to post the relevant parts only.
Thank you!
Pep
#########FULL BACKUP###############
xtrabackup --defaults-file=/home/my3306/my.cnf -uroot -p’pAssWord123’ --socket=/home/my3306/run/mysql.sock --backup --target-dir=/home/backup/backupdir/full
######LOGS
Transaction log of lsn (20544705) to (20544715) was copied.
######XINFO
binlog_pos = filename ‘mysql-bin.000052’, position ‘193’, GTID of the last change ‘0f037394-ac37-11ed-8b43-5254bb991234:1-106’
innodb_from_lsn = 0
innodb_to_lsn = 20544705
#########INCREMENTAL BACKUP###############
xtrabackup --defaults-file=/home/my3306/my.cnf -uroot -p’pAssWord123’ --socket=/home/my3306/run/mysql.sock --backup --target-dir=/home/backup/backupdir/inc1 --incremental-basedir=/home/backup/backupdir/full
######LOGS
[Xtrabackup] incremental backup from 20544705 is enabled.
[Xtrabackup]Transaction log of lsn (20545575) to (20546750) was copied.
######XINFO
binlog_pos = filename ‘mysql-bin.000053’, position ‘193’, GTID of the last change ‘0f037394-ac37-11ed-8b43-5254bb991234:1-107’
innodb_from_lsn = 20544705
innodb_to_lsn = 20545575
######## above bakcup is ok #############
#########RESTORE ###############
xtrabackup --prepare --apply-log-only --target-dir=/home/backup/backupdir/full
[Xtrabackup] This target seems to be not prepared yet.
[InnoDB] The log sequence number 19656859 in the system tablespace does not match the log sequence number 20544705 in the redo log files!
[InnoDB] Database was not shutdown normally!
[InnoDB] Starting crash recovery.
[InnoDB] Starting to parse redo log at lsn = 20544543, whereas checkpoint_lsn = 20544705 and start_lsn = 20544512
[InnoDB] Doing recovery: scanned up to log sequence number 20544705
[InnoDB] Log background threads are being started…
[InnoDB] Applying a batch of 0 redo log records …
[InnoDB] Apply batch completed!
[InnoDB] Using undo tablespace ‘./undo_001’.
[InnoDB] Using undo tablespace ‘./undo_002’.
[InnoDB] Opened 2 existing undo tablespaces.
[InnoDB] Shutdown completed; log sequence number 20544715 <<<<<<not equal to xinfo-to_lsn
xtrabackup --prepare -target-dir=/home/backup/backupdir/full --incremental-basedir=/home/backup/backupdir/inc1
[Xtrabackup] This target seems to be already prepared with --apply-log-only.
[Xtrabackup] xtrabackup_logfile was already used to ‘–prepare’. <<<< report already --prepare
[InnoDB] Log background threads are being closed…
[InnoDB] Shutdown completed; log sequence number 20545558 <<<< not equal to XINFO-to_lsn
rsync -avrP /home/backup/backupdir/full/ /home/my3307/data/
chown -R mysql:mysql /home/my3307
/opt/mysql/bin/mysqld_safe --defaults-file=/home/my3307/my.cnf &
mysql -uroot -p’pAssWord123’ --socket=/home/my3307/run/mysql.sock
above ops to startup database. select table the rows is not same.
the last row is insert before incremental backup.
mysql> select * from inc1;
±—±------+
| id | name |
±—±------+
| 10 | inc1 |
| 11 | inc11 |
±—±------+
mysql> select * from testdb.inc1;
±—±-----+
| id | name |
±—±-----+
| 10 | inc1 |
±—±-----+
Pep_Pla
February 21, 2023, 12:14pm
8
xtrabackup --prepare -target-dir=/home/backup/backupdir/full --incremental-basedir=/home/backup/backupdir/inc1
Not sure if this is a copy&paste error, but -target-dir
has a missing -
.
copy error.
xtrabackup --prepare --target-dir=/home/backup/backupdir/full --incremental-basedir=/home/backup/backupdir/inc1
if you have time. you can test it.
i can not success.
Pep_Pla
February 21, 2023, 2:11pm
11
I’ll try to test it, but I may need a few days to test.
Could you tell me the operating system version/distribution/cpu family?
Are you using version 8.0.31 both for the database and xtrabackup?
Could you tell me the operating system version/distribution/cpu family?
Os is openeuler, 20.03, X86 same as centos 7
Are you using version 8.0.31 both for the database and xtrabackup?
Yes, both of them is 8.0.31.
I test on redhat 7.6 , it has same result.
[root@mysql1 backup]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
[InnoDB] Shutdown completed; log sequence number 19413992
innodb_from_lsn = 0
innodb_to_lsn = 19413982
I have found the problem, apply incremental backup uses incremental-basedir option, but the correct option is incremental-dir.
thanks for your patience.
1 Like