开启tiflash副本报错问题,other error for mpp stream......

现象说明:tb_xx开启了tiflash副本后,执行查询语句报错。删掉tiflash副本后,查询正常。
怀疑:datediff( c_create_dt, str_to_date( TIMESTAMP ( ‘2024-04-03 00:00:00’ ), ‘%Y-%m-%d %H:%i:%s’ ) 函数问题?比如在不支持mpp算子下推的范围里。
各位 童靴帮忙分析下!!
执行语句:

SELECT
	* 
FROM
	tb_xx 
WHERE
	company = '0112' 
	AND datediff( c_create_dt, str_to_date( TIMESTAMP ( '2024-04-03 00:00:00' ), '%Y-%m-%d %H:%i:%s ' ) ) >= 0 
	AND datediff( c_create_dt, str_to_date( TIMESTAMP ( '2024-04-03 00:00:00' ), '%Y-%m-%d %H:%i:%s' ) ) <= 0 
	AND store = '16074001' 
	AND store IN ( '16074001' ) 
ORDER BY
	c_create_dt DESC 
	LIMIT 1000 OFFSET 0

错误信息:

<!--p.MsoNormal{ mso-style-name: 正文; mso-style-parent: ""; margin: 0pt; margin-bottom: .0001pt; mso-pagination: none; text-justify: inter-ideograph; mso-font-kerning: 1.0000pt; } p.paragraph{ mso-style-noshow: yes; margin-top: 5.0000pt; margin-right: 0.0000pt; margin-bottom: 5.0000pt; margin-left: 0.0000pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; text-align: left; font-family: 等线; mso-bidi-font-family: 'Times New Roman'; font-size: 12.0000pt; } -->

1105 - other error for mpp stream: From MPP<query:448959672348311565,task:1>: Code: 49, e.displayText() = DB::Exception: Check schema[i].type->equals(*storage_schema[i].type) failed, schema[i].name = table_scan_1, schema[i].type->getName() = Nullable(MyDateTime(3)), storage_schema[i].name = c_create_dt, storage_schema[i].type->getName() = Nullable(MyDateTime(0)), e.what() = DB::Exception,

我执行了下面的预期也是报错,
select c_create_dt,c_create_userno from tb_xxx where c_create_dt is not null

1105 - other error for mpp stream: From MPPquery:448959672348311565:1,task: Code: 49, e.displayText() = DB::Exception: Check schema[i].type->equals(*storage_schema[i].type) failed, schema[i].name = table_scan_1, schema[i].type->getName() = Nullable(MyDateTime(3)), storage_schema[i].name = c_create_dt, storage_schema[i].type->getName() = Nullable(MyDateTime(0)), e.what() = DB::Exception,

确认Tiflash服务是正常的吗 Tiflash版本是 ? 可以使用hint强制走TiKV,不使用Tiflash /*+ READ_FROM_STORAGE(TIKV[db1.table]) */

这个去年遇到过,只要这个表开启tiflash副本,在生产坏境集群版本是6.5.3 就报错。 测试坏境是6.5.8没有报错。

mark一下,可能是不兼容

看一下表结构,应该是使用了这种类型字段 mydatetime(0) mydatetime(3) timestamp(0) timestamp(3) time(0) time(3),导致tiflash报错,
受影响的 LTS 版本:

  • 版本 6.5.0/v6.5.1/v6.5.2/v6.5.3
  • 版本 7.1.0/v7.1.1

解决方法(从以下操作中选择 1 个操作):

  1. 在 TiFlash 中关闭 Planner Interpreter,如下配置。对于受影响的版本,禁用此功能无关紧要
[profiles]
[profiles.default]
enable_planner = false
  1. 使用正确的列类型创建新列;将值从旧列复制到新列 using 语句;删除旧列UPDATE table_name SET ...
  2. 创建具有正确列类型的新表;将旧表中的行复制到新表;删除旧表

使用 MyDateTime(0) 对 MyDateTime(3) 的架构检查失败 ·问题 #7809 ·pingcap/tiflash (github.com)

1 个赞

怀疑是函数支持问题

字段类型导致的吗