溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

解決MySQL 使用xtrabackup備份失敗方法簡(jiǎn)析

發(fā)布時(shí)間:2020-04-29 14:50:10 來(lái)源:億速云 閱讀:559 作者:三月 欄目:MySQL數(shù)據(jù)庫(kù)

本文主要給大家介紹解決MySQL使用xtrabackup備份失敗方法簡(jiǎn)析,文章內(nèi)容都是筆者用心摘選和編輯的,具有一定的針對(duì)性,對(duì)大家的參考意義還是比較大的,下面跟筆者一起了解下主題內(nèi)容吧。

收到報(bào)警,某個(gè)端口備份失敗,查看備份日志如下,顯示有DDL操作導(dǎo)致的備份中斷,查看當(dāng)時(shí)的二進(jìn)制日志,當(dāng)時(shí)執(zhí)行了一條添加字段的sql語(yǔ)句。目前只能重新執(zhí)行備份,并修改備份時(shí)間,避免再發(fā)生類似情況。

MySQL:5.7.11

xtrabackup:2.4.5

查找到官方修復(fù)bug的情況:

Running DDL statements on Percona Server 5.7 during the backup process could in some cases lead to failure while preparing the backup. Bug fixed #1555626.

MySQL 5.7 can sometimes skip redo logging when creating an index. If such ALTER TABLE is being issued during the backup, the backup would be inconsistent. xtrabackup will now abort with error message if such ALTER TABLEhas been done during the backup. Bug fixed #1582345.

所以說(shuō)這種情況是正常的,應(yīng)盡量避免在備份時(shí)執(zhí)行這些sql

備份日志:

解決MySQL 使用xtrabackup備份失敗方法簡(jiǎn)析

InnoDB: Last flushed lsn: 340748764928 load_index lsn 340748904772
# 一個(gè)DDL操作已經(jīng)執(zhí)行(未記錄redo日志)。影響到的行可能未落地,PXB不能確保備份的一致性,請(qǐng)重試
[FATAL] InnoDB: An optimized(without redo logging) DDLoperation has been performed. All modified pages may not have been flushed to the disk yet.
    PXB will not be able take a consistent backup. Retry the backup operation
    # 斷言失敗
2017-06-01 08:43:19 0x7f396ee27700  InnoDB: Assertion failure in thread 139884650198784 in file ut0ut.cc line 916
# 故意生成一個(gè)內(nèi)存陷阱,使備份中斷
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
00:43:19 UTC - xtrabackup got signal 6 ;
This could be because you hit a bug or data is corrupted.
This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x10000
/usr/local/xtrabackup/bin/innobackupex(my_print_stacktrace+0x35)[0xd55c45]
/usr/local/xtrabackup/bin/innobackupex(handle_fatal_signal+0x273)[0xb0d5a3]
/lib64/libpthread.so.0[0x36ac20f710]
/lib64/libc.so.6(gsignal+0x35)[0x36abe32625]
/lib64/libc.so.6(abort+0x175)[0x36abe33e05]
/usr/local/xtrabackup/bin/innobackupex[0x7bfbe5]
/usr/local/xtrabackup/bin/innobackupex(_ZN2ib5fatalD1Ev+0xb3)[0x837743]
/usr/local/xtrabackup/bin/innobackupex[0x8af4a1]
/usr/local/xtrabackup/bin/innobackupex(_Z19recv_parse_log_recsm7store_tb+0x4df)[0x8b20ef]
/usr/local/xtrabackup/bin/innobackupex[0x763b60]
/usr/local/xtrabackup/bin/innobackupex[0x764176]
/usr/local/xtrabackup/bin/innobackupex[0x764523]
/lib64/libpthread.so.0[0x36ac2079d1]
/lib64/libc.so.6(clone+0x6d)[0x36abee88fd]
Please report a bug at https://bugs.launchpad.net/percona-xtrabackup

看完以上關(guān)于解決MySQL 使用xtrabackup備份失敗方法簡(jiǎn)析,很多讀者朋友肯定多少有一定的了解,如需獲取更多的行業(yè)知識(shí)信息 ,可以持續(xù)關(guān)注我們的行業(yè)資訊欄目的。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI