v5.1.0升级到v5.1.1时tiflash报错

【 TiDB 使用环境】
【概述】:场景 + 问题概述
在使用tiup cluster upgrade升级时,tiflash节点报错,如下:

【附件】:

  • 相关日志
    在升级时tiflash日志中报错如下:
    Bootstrap failed because sync schema error: DB::Exception: Wrong precision:0

不升级时也有报错,这个报错一直有如下:

2 个赞

麻烦发一下 PD leader 的 log 以及当前 tiflash 最新的 log

1 个赞

tiflash.tar.gz (160.5 KB) [quote=“Lucien, post:2, topic:123429”]
leader
[/quote]
pd日志如下:
链接:百度网盘-链接不存在
提取码:d531

说明:pd的日志是全部日志,tiflash日志,我是清空后,重新做了一次upgrade升级产生的新日志

1 个赞

Altering table daas(121).product(2786)"

帮忙看一下这张表的 tiflash 副本情况,现在 tiflash 状态是不可用 ?

1 个赞


是这样查看吗?

是的,现在是把 tiflash 的复盘都删掉吗?

https://docs.pingcap.com/zh/tidb/v5.0/use-tiflash#注意事项

可以先试着把副本配置起来,看看是否还会有报错。

tiflash我们之前没有使用,当时是预留的。

刚刚给表加了副本

但是日志是报错了

可以发一下我们的机器规模和配置一下吗?

所有机器都是8C 32G 500G(ssd),(这些都在公司的虚机平台上)

集群如下:

根据https://docs.pingcap.com/zh/tidb/stable/troubleshoot-tiflash#tiflash-%E5%89%AF%E6%9C%AC%E5%A7%8B%E7%BB%88%E5%A4%84%E4%BA%8E%E4%B8%8D%E5%8F%AF%E7%94%A8%E7%8A%B6%E6%80%81
我检查了一下,下面是检查的结果,希望有帮助
[appadmin@walle91228 v5.1.0]$ echo ‘config show replication’ | /home/appadmin/.tiup/components/ctl/v5.1.0/pd-ctl -u http://10.97.5.50:2379
{
“max-replicas”: 3,
“location-labels”: “”,
“strictly-match-label”: “false”,
“enable-placement-rules”: “true”,
“isolation-level”: “”
}

[appadmin@walle91228 v5.1.0]$ echo “store” | /home/appadmin/.tiup/components/ctl/v5.1.0/pd-ctl -u http://10.97.5.50:2379
{
“count”: 4,
“stores”: [
{
“store”: {
“id”: 5,
“address”: “10.97.7.36:20160”,
“version”: “5.1.0”,
“status_address”: “10.97.7.36:20180”,
“git_hash”: “5a2d13fe14a31edee3c98715ac575b1663c0df47”,
“start_timestamp”: 1627297481,
“deploy_path”: “/data/deploy/bin”,
“last_heartbeat”: 1629961336575206440,
“state_name”: “Up”
},
“status”: {
“capacity”: “492GiB”,
“available”: “434.1GiB”,
“used_size”: “661.5MiB”,
“leader_count”: 488,
“leader_weight”: 1,
“leader_score”: 488,
“leader_size”: 632,
“region_count”: 1465,
“region_weight”: 1,
“region_score”: 2747,
“region_size”: 2747,
“start_ts”: “2021-07-26T19:04:41+08:00”,
“last_heartbeat_ts”: “2021-08-26T15:02:16.57520644+08:00”,
“uptime”: “739h57m35.57520644s”
}
},
{
“store”: {
“id”: 88,
“address”: “10.97.7.52:3930”,
“labels”: [
{
“key”: “engine”,
“value”: “tiflash”
}
],
“version”: “v5.1.1”,
“peer_address”: “10.97.7.52:20170”,
“status_address”: “10.97.7.52:20292”,
“git_hash”: “c8fabfb50fe28db17cc5118133a69be255c40efd”,
“start_timestamp”: 1629961337,
“deploy_path”: “/data/deploy/tiflash-9000/bin/tiflash”,
“last_heartbeat”: 1629874783994799812,
“state_name”: “Down”
},
“status”: {
“capacity”: “492GiB”,
“available”: “492GiB”,
“used_size”: “380.8KiB”,
“leader_count”: 0,
“leader_weight”: 1,
“leader_score”: 0,
“leader_size”: 0,
“region_count”: 1,
“region_weight”: 1,
“region_score”: 1,
“region_size”: 1,
“start_ts”: “2021-08-26T15:02:17+08:00”,
“last_heartbeat_ts”: “2021-08-25T14:59:43.994799812+08:00”
}
},
{
“store”: {
“id”: 1,
“address”: “10.97.7.49:20160”,
“version”: “5.1.0”,
“status_address”: “10.97.7.49:20180”,
“git_hash”: “5a2d13fe14a31edee3c98715ac575b1663c0df47”,
“start_timestamp”: 1627297503,
“deploy_path”: “/data/deploy/bin”,
“last_heartbeat”: 1629961342967408912,
“state_name”: “Up”
},
“status”: {
“capacity”: “492GiB”,
“available”: “432.2GiB”,
“used_size”: “728.2MiB”,
“leader_count”: 485,
“leader_weight”: 1,
“leader_score”: 485,
“leader_size”: 899,
“region_count”: 1465,
“region_weight”: 1,
“region_score”: 2747,
“region_size”: 2747,
“start_ts”: “2021-07-26T19:05:03+08:00”,
“last_heartbeat_ts”: “2021-08-26T15:02:22.967408912+08:00”,
“uptime”: “739h57m19.967408912s”
}
},
{
“store”: {
“id”: 4,
“address”: “10.97.7.29:20160”,
“version”: “5.1.0”,
“status_address”: “10.97.7.29:20180”,
“git_hash”: “5a2d13fe14a31edee3c98715ac575b1663c0df47”,
“start_timestamp”: 1627297454,
“deploy_path”: “/data/deploy/bin”,
“last_heartbeat”: 1629961341032716706,
“state_name”: “Up”
},
“status”: {
“capacity”: “492GiB”,
“available”: “430.7GiB”,
“used_size”: “664.2MiB”,
“leader_count”: 492,
“leader_weight”: 1,
“leader_score”: 492,
“leader_size”: 1216,
“region_count”: 1465,
“region_weight”: 1,
“region_score”: 2747,
“region_size”: 2747,
“start_ts”: “2021-07-26T19:04:14+08:00”,
“last_heartbeat_ts”: “2021-08-26T15:02:21.032716706+08:00”,
“uptime”: “739h58m7.032716706s”
}
}
]
}

[appadmin@walle91228 v5.1.0]$ echo ‘config placement-rules show’ | /home/appadmin/.tiup/components/ctl/v5.1.0/pd-ctl -u http://10.97.5.50:2379
[
{
“group_id”: “pd”,
“id”: “default”,
“start_key”: “”,
“end_key”: “”,
“role”: “voter”,
“count”: 3
},
{
“group_id”: “tiflash”,
“id”: “table-2786-r”,
“override”: true,
“start_key”: “748000000000000AFFE25F720000000000FA”,
“end_key”: “748000000000000AFFE300000000000000F8”,
“role”: “learner”,
“count”: 1,
“label_constraints”: [
{
“key”: “engine”,
“op”: “in”,
“values”: [
“tiflash”
]
}
]
}
]

可以发一下 product 这张表的 schema 吗?

Create Table: CREATE TABLE product (
id bigint(20) NOT NULL AUTO_INCREMENT,
contract_num varchar(100) COLLATE utf8_general_ci DEFAULT NULL,
contract_name varchar(50) COLLATE utf8_general_ci DEFAULT NULL,
sku_id bigint(20) DEFAULT NULL COMMENT ‘sku_id’,
signed_product_num varchar(50) COLLATE utf8_general_ci DEFAULT NULL,
signed_product_name varchar(100) COLLATE utf8_general_ci DEFAULT NULL,
brand int(11) DEFAULT NULL’,
classification int(11) DEFAULT NULL,
specification_description varchar(250) COLLATE utf8_general_ci DEFAULT NULL,
service_description varchar(200) COLLATE utf8_general_ci DEFAULT NULL,
price_review_status tinyint(4) DEFAULT NULL,
shelf_status tinyint(4) DEFAULT NULL,
shelf_status_date datetime DEFAULT NULL,
ecc_code varchar(100) COLLATE utf8_general_ci DEFAULT NULL,
customer_code varchar(50) COLLATE utf8_general_ci DEFAULT NULL,
customer_name varchar(50) COLLATE utf8_general_ci DEFAULT NULL,
remarks varchar(200) COLLATE utf8_general_ci DEFAULT NULL,
create_time datetime DEFAULT NULL,
create_by varchar(50) COLLATE utf8_general_ci DEFAULT NULL,
update_time datetime DEFAULT NULL,
update_by varchar(50) COLLATE utf8_general_ci DEFAULT NULL,
contract_start_date date DEFAULT NULL,
contract_end_date date DEFAULT NULL,
price_review_time datetime DEFAULT NULL,
own_contract_subject varchar(255) COLLATE utf8_general_ci DEFAULT NULL,
other_contract_subject_list varchar(500) COLLATE utf8_general_ci DEFAULT NULL,
irr_id int(11) DEFAULT NULL,
signed_product_id int(11) DEFAULT NULL,
product_info varchar(500) COLLATE utf8_general_ci DEFAULT NULL,
project_code varchar(255) COLLATE utf8_general_ci DEFAULT NULL,
company_name varchar(500) COLLATE utf8_general_ci DEFAULT NULL,
company_code bigint(20) DEFAULT NULL,
sub_company_code bigint(20) DEFAULT NULL,
sub_company_name varchar(50) COLLATE utf8_general_ci DEFAULT NULL,
customer_type int(11) DEFAULT NULL,
parent_contract_num varchar(50) COLLATE utf8_general_ci DEFAULT NULL,
fixed_asset_code varchar(255) COLLATE utf8_general_ci DEFAULT NULL,
rent_hold_manufacturer varchar(255) COLLATE utf8_general_ci DEFAULT NULL,
equipment_type varchar(255) COLLATE utf8_general_ci DEFAULT NULL,
new_old_attr tinyint(0) DEFAULT NULL,
nums int(0) DEFAULT NULL,
residual_value_rate decimal(0,0) DEFAULT NULL,
is_initial tinyint(4) NOT NULL DEFAULT ‘0’,
PRIMARY KEY (id) /*T![clustered_index] CLUSTERED */,
UNIQUE KEY UN_PRODUCT_NUM (signed_product_num)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=510014
1 row in set (0.00 sec)

  1. 这个集群最初的版本是多少?
  2. 为什么 residual_value_rate 这个字段的类型是 decimal(0,0) 呢?

这套是从v4.0.0开始用的
image

字段中那么定义是开发人员这样弄的,好些表中都是这样的,如果是因为这个的原因,后面要找他们负责人统一一个时间做更改(我希望是这个原因)

建议把 residual_value_rate 这个字段的类型改掉然后重建一下 tiflash 节点,这个类型属于一个非法类型。(我本地在 tidb 5.1 版本上测试了一下,目前 tidb 已经不允许创建 decimal(0,0) 的字段,会被自动转成 decimal(10,0))

2 个赞

预期是可以解决报错的问题。

我弄个测试环境(自己的虚机),然后在上面测试一下啊

我这边测试了一下,如果在v5.1.1版本中新创建表时 decimal(0,0) 的字段,会被自动转成 decimal(10,0)),然后tilash是可以用的

后面我找开发负责人沟通这个事

谢谢!

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。