mysql errorlog 大量[Warning] [MY-010956] [Server]导致体积errorlog体积暴增

问题描述

最近突然发现mysql 从库error log里面大量报错如下
[Warning] [MY-010956] [Server] Invalid replication timestamps: original commit timestamp is more recent than the immediate commit timestamp. This may be an issue if delayed replication is active. Make sure that servers have their clocks set to the correct time. No further message will be emitted until after timestamps become valid again.
由于写入了大量的这种warning报错,从而导致errorlog体积暴增,截图如下

[Warning] [MY-010956] [Server] Invalid replication timestamps: original commit timestamp is more recent than the immediate commit timestamp. This may be an issue if delayed replication is active. Make sure that servers have their clocks set to the correct time. No further message will be emitted until after timestamps become valid again.

解决方案

经过查询文档发现这个报错是一个时间戳的bug,但是如何解决暴增的问题呢?
首先由于这个是报错是waring级别,并不影响我们业务,所以我们可以通过以下方式去解决。
我先解释一下两个参数
log_error_verbosity:三个可选值分别为1,2,3。
1表示errorlog只记录错误信息,即[error]
2表示errorlog只记录错误信息和告警信息,即[error][warning]
3表示errorlog记录错误信息和告警信息和通知信息,即[error][warning][info]
这个参数再5.7及以上版本可以使用

所以解决的话可以通过设置log_error_verbosity为1来解决问题,但是该种会导致其他的warning信息不记录到errorlog,导致其他warning不可见。

但是我们线上使用的8.0版本,在mysql8.0引入了一个参数
log_error_suppression_list
该参数可以将对应的报错抑制从而遇到对应的报错不写入errorlog
所以可以将该参数的值设置为“MY-010956”即可遇到对应的报错不写入errlog,遇到多个值的时候可以逗号分隔开写多个。这样既可以解决errorlog暴增问题以及也可以看到其他的warning信息。即

set global log_error_verbosity=2 #也可以不设置,因为该值默认是2
set global log_error_suppression_list='MY-010956'

但是注意log_error_suppression_list这个参数要是要生效的话一定要确认
log_error_services参数里面有log_filter_internal这个service,抑制列表
log_error_suppression_list这个参数才会生效。

 

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值