因参数innodb_undo_directory的配置问题,导致xtrabackup备份失败

2023-05-16

软件环境描述

centos7.3
mysql5.7.29 二进制安装包
xtrabckup2.4.18 二进制安装包

在进行数据库物理备份的时候,遇到如下报错

2020-03-03 20:24:49 0x7f324f9cb740  InnoDB: Assertion failure in thread 139854060762944 in file srv0start.cc line 928
InnoDB: Failing assertion: dir
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.
12:24:49 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
innobackupex(my_print_stacktrace+0x2c)[0xd972dc]
innobackupex(handle_fatal_signal+0x262)[0xa4a4c2]
/lib64/libpthread.so.0(+0xf5f0)[0x7f324f5be5f0]
/lib64/libc.so.6(gsignal+0x37)[0x7f324db17337]
/lib64/libc.so.6(abort+0x148)[0x7f324db18a28]
innobackupex[0x7180cb]
innobackupex(_Z25srv_undo_tablespaces_initbbmPm+0x1b85)[0xb3cd95]
innobackupex[0x7469de]
innobackupex(_Z22xtrabackup_backup_funcv+0xf12)[0x748cd2]
innobackupex(main+0xe15)[0x725495]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f324db03505]
innobackupex[0x73d3e4]

Please report a bug at https://jira.percona.com/projects/PXB

排查过程

1.未检查配置文件的情况下,怀疑是xtrabckup和mysql的版本不兼容的问题,
更换xtrabackup的版本和mysql的小版本,都不能备份成功(依然报错)

2.使用rpm安装mysql社区版本,使用xtrabackup2.4备份,成功,此时才怀疑是配置文件的问题,
使用二进制安装程序下mysqld初始化新端口,使用最简单的my.cnf配置(修改datadir),备份成功

3.最终确定是配置文件的问题,于是排查配置文件,发现innodb_undo_directory参数配置了,
于是怀疑是这个参数的问题(安装脚本里并没有创建这个目录)

4.经过几次修改innodb_undo_directory参数的位置并进行备份测试,确定是由于该参数的配置目录实际上并不存在而导致以上报错

实验过程简单记录

1.innodb_undo_directory的位置并不存在时
innodb_undo_directory = /data/mysql8899/nodir/

备份--失败
rm -rf /data/backup_xtrabackup/*
innobackupex --defaults-file=/data/mysql8899/mycnf/my_8899.cnf --user=root --password=Root#2018 --host=127.0.0.1 --port=8899 --socket=/data/mysql8899/data/mysql8899.sock /data/backup_xtrabackup/

InnoDB: Number of pools: 1
200304 06:53:19 >> log scanned up to (2624040)
2020-03-04 06:53:19 0x7f3b42dd0740  InnoDB: Assertion failure in thread 139892501579584 in file srv0start.cc line 928
InnoDB: Failing assertion: dir



2.innodb_undo_directory的位置存在时
innodb_undo_directory = /data/mysql8899/undolog/

手动创建这个目录 
mkdir -p /data/mysql8899/undolog/ (实际并未赋予mysql属组)

备份--成功
rm -rf /data/backup_xtrabackup/*
innobackupex --defaults-file=/data/mysql8899/mycnf/my_8899.cnf --user=root --password=Root#2018 --host=127.0.0.1 --port=8899 --socket=/data/mysql8899/data/mysql8899.sock /data/backup_xtrabackup/

问题总结梳理

1.遇到类似的问题,首先要相信软件本身,是可以解决常规问题的。
不能盲目猜测(如果一开始就相信,xtrbackup软件 和 二进制安装程序是没有问题的,那这个问题的排查过程就会大大的缩减)。
2.对于my.cnf的配置项,要有敬畏之心。
不能拿来主义,每个参数都要熟知于心。
遇到新的参数,一定要做足测试,才可以使用(至少备份、恢复、不同集群架构、自动化运维、数据归档处理、mysql周边辅助工具以及在percona分支、mariadb下的这些场景下,都要进行)

参数说明
innodb_undo_directory
InnoDB undo日志所在表空间的物理路径。和innodb_undo_logs、innodb_undo_tablespaces参数配合,来设置undo日志的路径,默认路径是数据文件路径

Undo tablespaces contain undo logs, which are collections of undo log records that contain information about how to undo the latest change by a transaction to a clustered index record. Undo logs exist within undo log segments, which are contained within rollback segments. The innodb_rollback_segments variable defines the number of rollback segments allocated to each undo tablespace.
Undo logs can be stored in one or more undo tablespaces instead of the system tablespace. This layout differs from the default configuration in which undo logs reside in the system tablespace. The I/O patterns for undo logs make undo tablespaces good candidates for SSD storage, while keeping the system tablespace on hard disk storage.
The number of undo tablespaces used by InnoDB is controlled by the innodb_undo_tablespaces configuration option. This option can only be configured when initializing the MySQL instance. It cannot be changed afterward.

另外,需要注意这个参数在后续的版本将会移除
在这里插入图片描述

参考网址
https://dev.mysql.com/doc/refman/5.7/en/innodb-undo-tablespaces.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

因参数innodb_undo_directory的配置问题,导致xtrabackup备份失败 的相关文章

  • 消除if...else的十种方法

    前言 if else 是所有高级编程语言都有的必备功能 但现实中的代码往往存在着过多的 if else 虽然 if else 是必须的 xff0c 但滥用 if else 会对代码的可读性 可维护性造成很大伤害 xff0c 进而危害到整个软
  • Qt学习笔记(三)运行库依赖

    正常应该写release版本的依赖库 xff0c 不过都差不多 xff0c 自行转化就对了 自己使用qt版本 Qt5 15 2 xff0c 因为我只编译了debug版本程序 xff0c 暂时只能拿debug说事了 直接查找依赖可以找到依赖有
  • 宽带测速网站收集

    国际通用 xff1a https www speedtest net http www speedtest cn xff08 国产 xff0c 主要服务器节点多 xff09 电信 xff1a https 10000 gd cn 移动 xff
  • 使用Git为每个项目配置独立的用户名和邮箱

    使用Git为每个项目配置独立的用户名和邮箱 平时在开发的过程中 xff0c 用到git时 xff0c 要做一些特殊的配置 xff0c 例如自己公司内网https的SSL证书未经过第三方机构签署 xff0c 直接操作Git就会报错 xff0c
  • 电脑重装系统后文件还能恢复吗?2个方法助你还原文件

    电脑重装系统后文件还能恢复吗 xff1f 此时可能你面临一个难题 xff1a 已经重装了电脑 xff0c 但是发现丢失的问题 实际上 xff0c 一般当电脑出现运行缓慢 xff0c 或者是电脑系统出现故障无法修复的时候 xff0c 大家都会
  • C盘重装还能恢复以前文件嘛,重装C盘数据备份清单

    重装系统主要是对C盘的重装 xff0c 也就是对C盘的格式化 xff0c 电脑安装系统的位置是C盘 xff0c 常见的重装方法只影响C盘而不会丢失其他盘的数据 那么C盘重装还能恢复以前的文件嘛 xff1f 重装C盘时什么文件必须备份呢 xf
  • HTML Parsing Error:Unable to modify the parent container element before the child element is closed

    一 又涨见识了 IE8报下面错误 xff0c 而且是我的机器不报 xff0c 同事的机器报 xff0c 试了4台 xff0c 两个报 xff0c 两个不报 xff0c IE版本都一样 xff0c 没想明白 解决 xff1a 1 查看是否有未
  • 架构师必须学会的几种 UML图

    文章目录 一 UML 是什么定义作用 二 UML 画图的工具推荐三 UML 类图中的关系1 泛化 继承 2 实现 xff08 Realization xff09 3 关联 xff08 Association 4 聚合 xff08 Aggre
  • 算法:如何实现两个大数相加

    文章目录 问题要求思路代码实现 问题 实现两个很大很大的数相加 xff0c 求出它们的和 要求 1 是整数 xff1b 2 两个数无限大 xff0c long 都装不下 xff1b 3 不能用 BigInteger xff1b 4 不能用任
  • 关于Android 未来开发的方向探讨

    文章目录 背景Anroid 应用开发工程师技能参考Android 基础设施建设技能参考Android 逆向开发工程师技能参考Android Framework工程师技能参考 xff08 车载系统 系统开发方向 xff09 Android 性
  • Git Commit Message 规范实践

    文章目录 背景示例FeatureBugRefactorDocsTestStyleChore 每个Merge Request只有一个Commit小结附录 背景 本文总结了项目实践中的 Commit Message 规范 任何一笔提交都是有原因
  • github push 报错的问题记录

    文章目录 背景解决办法示例 背景 当 git 执行 git push xff08 origin origin master xff09 后出现错误提示 xff1a git push origin origin master Password
  • Mac 平台 Android FFmpeg 编译与集成实践

    文章目录 FFmpeg 是什么为什么要学 FFmpeg 开发FFmpeg 编译1 编译环境准备2 FFmpeg 环境配置3 完整的脚本4 FQA 编译小结在Android Studio 中的集成集成问题记录写在最后 FFmpeg 是什么 F
  • 音频中文件大小计算公式(转)

    声卡对声音的处理质量可以用三个基本参数来衡量 xff0c 即采样频率 采样位数和声道数 采样频率是指单位时间内的采样次数 采样频率越大 xff0c 采样点之间的间隔就越小 xff0c 数字化后得到的声音就越逼真 xff0c 但相应的数据量就
  • 「设计模式」六大原则之一:单一职责小结

    文章目录 1 单一职责原则定义2 如何理解单一职责原则 xff08 SRP xff09 xff1f 3 如何判断类的职责是否足够单一 xff1f 4 类的职责是否设计得越单一越好 xff1f 5 应用体现6 应用示例18 应用示例2 xff
  • 「设计模式」六大原则之二:开闭职责小结

    文章目录 1 开闭原则定义2 如何理解 对扩展开放 对修改关闭 xff1f 3 如何做到 对扩展开放 修改关闭 xff1f 4 如何在项目中灵活应用开闭原则 xff1f 5 示例 xff1a 6 小结 xff1a 设计模式 六大原则系列链接
  • 「设计模式」六大原则之三:里氏替换原则小结

    文章目录 1 里式替换原则定义2 举例说明示例1 xff1a 示例2 xff1a 3 哪些代码明显违背了 LSP xff1f 子类违背父类声明要实现的功能子类违背父类对输入 输出 异常的约定子类违背父类注释中所罗列的任何特殊说明开发 Tip
  • 「设计模式」六大原则之四:接口隔离原则小结

    文章目录 1 接口隔离原则定义2 如何理解3 接口隔离原则与单一职责原则的区别2 举例说明4 小结 设计模式 六大原则系列链接 设计模式 六大原则之一 xff1a 单一职责小结 设计模式 六大原则之二 xff1a 开闭职责小结 设计模式 六
  • 「设计模式」六大原则之五:依赖倒置原则小结

    文章目录 1 依赖倒置原则 xff08 DIP xff09 定义4 DIP举例说明2 如何理解控制反转 xff08 IOC xff09 3 如何理解依赖注入 xff08 DI xff09 4 小结 设计模式 六大原则系列链接 设计模式 六大
  • 「设计模式」六大原则之六:最小知识原则小结

    文章目录 1 最小知识原则 xff08 LOD xff09 定义2 什么是 高内聚 呢3 什么是 松耦合 xff1f 4 应用举例 设计模式 六大原则系列链接 设计模式 六大原则之一 xff1a 单一职责小结 设计模式 六大原则之二 xff

随机推荐