tiflash 告警:【TiDB ERR】[emergency]TiFlash_schema_error

能否发下日志文件呢?会有更多的上下文信息

刚才没保存,我把tiflash 先给下线了,想重新部署试试看,结果部署也失败,tiflash 日志显示022.04.02 17:06:09.511406 [ 1 ] Application: The configuration “path” is deprecated. Check [storage] section for new style.
2022.04.02 17:06:15.572535 [ 1 ] Application: basic_string::_M_replace_aux
2022.04.02 17:06:31.640767 [ 1 ] Application: The configuration “path” is deprecated. Check [storage] section for new style.
2022.04.02 17:06:37.881039 [ 1 ] Application: basic_string::_M_replace_aux
2022.04.02 17:06:53.973737 [ 1 ] Application: The configuration “path” is deprecated. Check [storage] section for new style.
2022.04.02 17:07:00.214609 [ 1 ] Application: basic_string::_M_replace_aux
2022.04.02 17:07:16.357215 [ 1 ] Application: The configuration “path” is deprecated. Check [storage] section for new style.
2022.04.02 17:07:22.595234 [ 1 ] Application: basic_string::_M_replace_aux
2022.04.02 17:07:38.674409 [ 1 ] Application: The configuration “path” is deprecated. Check [storage] section for new style.
2022.04.02 17:07:44.909858 [ 1 ] Application: basic_string::_M_replace_aux

1 个赞

能否看下 tiflash.log 呢

tiflash.log (3.9 MB) 您好这是刚刚部署tiflash 报错日志

1 个赞

看日志怀疑是 db_252.t_330 这个表有问题,请问是否方便提供下建表语句呢?

没有这个库表

wdapk.apk_icon_sample 这个呢:joy:

有这个表,当时业务反馈确实新建的这张表,是有什么问题吗,同时我发现一个奇怪的现象,我又部署相同版本的集群,都有个 check_time datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,字段,新部署的就会报错了,默认值不能为’0000’,旧集群还是可以创建的

CREATE TABLE apk_icon_sample (
id int(16) NOT NULL AUTO_INCREMENT,
apk_md5 varchar(32) NOT NULL DEFAULT ‘’,
check_time datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
apk_remark varchar(100) NOT NULL DEFAULT ‘’,
apk_state varchar(100) NOT NULL DEFAULT ‘105’,
apk_type varchar(100) NOT NULL DEFAULT ‘’,
add_time datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
add_user varchar(50) NOT NULL DEFAULT ‘’,
update_user varchar(50) NOT NULL DEFAULT ‘’,
update_time datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
state varchar(10) NOT NULL DEFAULT ‘0’,
icon_md5 varchar(32) NOT NULL DEFAULT ‘’,
icon longblob NOT NULL,
PRIMARY KEY (id) /*T![clustered_index] CLUSTERED */,
UNIQUE KEY idx_uniq (icon_md5),
KEY idx_update_time (update_time)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=90001

新旧集群都是 5.2.1版本的吗?

相同版本,您可以部署一个nightly 版本测试下上面语句,同时昨天我又部署了一个5.2.2版本的集群,测试是不是版本问题导致的,把旧集群的原先使用tiflash大表迁移过去了,然后创建tiflash,创建完成之后一段时间没问题,然后tiflash又挂了

tiflash.log (3.9 MB)

新部署时的报错是什么呢?ERROR 1067 (42000): Invalid default value for ‘check_time’ 这个吗?

对是这个报错

请问新集群和老集群建表时用的客户端是一样的吗?

https://docs.pingcap.com/zh/tidb/stable/data-type-date-and-time#datetime-类型
datetime 支持的范围是 0000-01-01 00:00:00.0000009999-12-31 23:59:59.999999,我试了一下在mysql 客户端会建表失败,改成 0000-01-01 00:00:00 就能建表成功了。
怀疑是这个默认值超出范围,某些地方没校验住,会有异常(虽然我本地还没复现出来)。如果急的话,先把check_time 的默认值改成范围内的值?
还有,您发的建表语句,单引号是中文的:joy:,你那边能建表成功吗?我替换成英文的单引号才建表成功。

1 个赞

我试了下sql_mode去掉 NO_ZERO_DATE可以建表成功,不过没能复现楼主的问题

check_time这个应该是sql_mode 的关系,但是还是不清楚为啥会报basic_string::_M_replace_aux问题

嗯这个是sql_mode 问题

我已经把check_time/add_time 字段都改成CURRENT_TIMESTAMP,现在重新扩容tiflash也会失败,错误日志一直报2022.04.06 13:59:05.853604 [ 1 ] Application: basic_string::_M_replace_aux
2022.04.06 13:59:21.359828 [ 1 ] Application: The configuration “path” is deprecated. Check [storage] section for new style.
2022.04.06 13:59:27.480685 [ 1 ] Application: basic_string::_M_replace_aux
2022.04.06 13:59:43.106669 [ 1 ] Application: The configuration “path” is deprecated. Check [storage] section for new style.
2022.04.06 13:59:49.228327 [ 1 ] Application: basic_string::_M_replace_aux
2022.04.06 14:00:04.754782 [ 1 ] Application: The configuration “path” is deprecated. Check [storage] section for new style.
2022.04.06 14:00:10.876427 [ 1 ] Application: basic_string::_M_replace_aux
2022.04.06 14:00:26.362460 [ 1 ] Application: The configuration “path” is deprecated. Check [storage] section for new style.
2022.04.06 14:00:32.483641 [ 1 ] Application: basic_string::_M_replace_aux