所有TIDB节点 TiDB_server_panic_total告警

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:

【TiDB 版本】
V5.0.0

【问题描述】

[conn.go:736] [“connection running loop panic”] [conn=749309] [lastSQL=“SELECT \ \tMD5(UUID()) AS id,\ \t\t\tom.order_no AS bill_no,\ \t\t\t1000 AS bill_type,\ \t\t\t2 AS root_check_type,\ \t\t\t108 AS check_type,\ \t\t\tom.out_date AS check_date,\ \t\t\t’POS’ AS sys_no,\ \t\t\t0 AS check_status,\ \t\t\tom.company_no,\ \t\t\tod.organ_no,\ \t\t\tod.brand_unit_no,\ \t\t\tom.shop_no AS store_no,\ \t\t\tom.shop_name AS store_name,\ \t\t\t’system’ AS create_user,\ \t\t\tNOW() AS create_time,\ \t\t\tom.sharding_flag\ \t \tFROM\ \t\t\tretail_pos.order_dtl od\ \t\tINNER JOIN retail_pos.order_main om ON om.order_no = od.order_no\ \t\tINNER JOIN retail_fas.shop_info s on s.shop_no = om.shop_no \ \t\tINNER JOIN retail_mps.rate_basic rb on rb.shop_no = om.shop_no and rb.rate_type = od.discount_type \ \t\tand (od.discount_type = 1 or (od.discount_type = 2 and (od.item_discount > rb.start_disc and od.item_discount <= rb.end_disc)))\ \t\tand om.out_date BETWEEN rb.start_date and rb.end_date and od.discount != rb.rate and rb.order_source = -1 and rb.concract_no is not null and rb.concract_no != ‘’\ \t\tWHERE om.company_no = ‘C9004’ and om.out_date >= ‘2021-04-01’ and om.out_date <= ‘2021-04-30’ and om.business_type in (0,1) and om.status >=30 \ \t\tAND od.discount_type IN (1,2)\ \t\tAND od.discount != 0 \ \t\tAND (od.category_no LIKE ‘41%’ or od.category_no LIKE ‘46%’ or od.category_no LIKE ‘47%’) \ \t\tAND s.property_way = ‘20160906000011’ and s.interior_channel != ‘20160906000005’ \ \t\tgroup by om.order_no\ \t\tUNION ALL\ \t\tSELECT \ \t\t\tMD5(UUID()) AS id,\ \t\t\trem.business_no AS bill_no,\ \t\t\t2000 AS bill_type,\ \t\t\t2 AS root_check_type,\ \t\t\t108 AS check_type,\ \t\t\trem.out_date AS check_date,\ \t\t\t’POS’ AS sys_no,\ \t\t\t0 AS check_status,\ \t\t\trem.company_no,\ \t\t\tred.organ_no,\ \t\t\tred.brand_unit_no,\ \t\t\trem.shop_no AS store_no,\ \t\t\trem.shop_name AS store_name,\ \t\t\t’system’ AS create_user,\ \t\t\tNOW() AS create_time,\ \t\t\trem.sharding_flag\ \t\t FROM\ \t\t\tretail_pos.return_exchange_dtl red\ \t\tINNER JOIN retail_pos.return_exchange_main rem ON rem.business_no = red.business_no\ \t\tINNER JOIN retail_fas.shop_info s on s.shop_no = rem.shop_no \ \t\tINNER JOIN retail_mps.rate_basic rb on rb.shop_no = rem.shop_no and rb.rate_type = red.discount_type \ \t\tand (red.discount_type = 1 or (red.discount_type = 2 and (red.item_discount > rb.start_disc and red.item_discount <= rb.end_disc)))\ \t\tand rem.out_date BETWEEN rb.start_date and rb.end_date and red.discount != rb.rate and rb.order_source = -1 and rb.concract_no is not null and rb.concract_no != ‘’\ \t\tWHERE rem.company_no = ‘C9004’ and rem.out_date >= ‘2021-04-01’ and rem.out_date <= ‘2021-04-30’ and rem.business_type in (0,1) and rem.status >=30 \ \t\tAND red.discount_type IN (1,2)\ \t\tAND red.discount != 0 \ \t\tAND (red.category_no LIKE ‘41%’ or red.category_no LIKE ‘46%’ or red.category_no LIKE ‘47%’) \ \t\tAND s.property_way = ‘20160906000011’ and s.interior_channel != ‘20160906000005’ \ \t\tgroup by rem.business_no”] [err=“runtime error: index out of range [-1]”] [stack=“goroutine 720807599 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x3ff6060, 0xc11aa7bdd0, 0xc079f30300)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:734 +0xee\ panic(0x378df20, 0xc0f4cdb8e0)\ \t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/planner/core.(*LogicalProjection).TryToGetChildProp(0xc07bec4d20, 0xc0155381c0, 0xc02571f260, 0x40da46705c4a16f1)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1927 +0x39a\ngithub.com/pingcap/tidb/planner/core.(*LogicalProjection).exhaustPhysicalPlans(0xc07bec4d20, 0xc0155381c0, 0xc07c219b00, 0x29, 0x5f84760, 0xc07c66a701)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1939 +0x50\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc07bec4d40, 0xc0ad247570, 0x5978228, 0x0, 0x0, 0x0, 0x0, 0x0)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:310 +0x1d5\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc07bf5e660, 0xc3b59eb980, 0x2, 0x3, 0xc0ad2469a0, 0xc07c66a600, 0x5978228, 0x10, 0x36a7b20, 0x0, …)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc07bf5e660, 0xc0ad246930, 0x5978228, 0x0, 0x0, 0x0, 0x0, 0x0)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc07bec4640, 0xc07c66a650, 0x1, 0x1, 0xc0ad2468c0, 0xc07a46e300, 0x5978228, 0x20, 0x36a7b20, 0xffffffffffffffff, …)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc07bec4640, 0xc0ad2467e0, 0x5978228, 0x0, 0x0, 0x0, 0x0, 0x0)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc07c2d3520, 0xc07c66a640, 0x1, 0x1, 0xc0ad246770, 0xc0ad246700, 0xc07a46e0f8, 0x68, 0x37cf7a0, 0xc07b538318, …)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc07c2d3520, 0xc0ad246700, 0xc07a46e0f8, 0x0, 0x0, 0x0, 0x0, 0x0)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.physicalOptimize(0x404b480, 0xc07c2d3500, 0xc07a46e0f8, 0x404b480, 0xc07c2d3500, 0x404b480, 0xc07c2d3500, 0x0)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:224 +0x131\ngithub.com/pingcap/tidb/planner/core.DoOptimize(0x3ff6060, 0xc08e8bc900, 0x404ec80, 0xc07a976100, 0x1cf6, 0x404b480, 0xc07c2d3500, 0x0, 0x0, 0x0, …)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:143 +0x13a\ngithub.com/pingcap/tidb/planner.optimize(0x3ff6060, 0xc08e8bc900, 0x404ec80, 0xc07a976100, 0x4014ec0, 0xc0c3d55590, 0x40412c0, 0xc09f6ed680, 0x0, 0x0, …)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/optimize.go:288 +0x66c\ngithub.com/pingcap/tidb/planner.Optimize(0x3ff6060, 0xc08e8bc900, 0x404ec80, 0xc07a976100, 0x4014ec0, 0xc0c3d55590, 0x40412c0, 0xc09f6ed680, 0x0, 0x0, …)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/ti”]


若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

应该是这个问题 https://github.com/pingcap/tidb/pull/23844 会在 v5.0.1 修复。 目前可以尝试 sql_mode 中的 only_full_group_by 去掉

1 个赞


我也碰到了,看来只能升级了

我也遇到了