[Bug]: [date 1.4]standalone regression:table exists but reported table "sbtest5" does not exist
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Branch Name
main
Commit ID
7db9fe187d1d70a196961e3332919d92cf825ac9
Other Environment Information
- Hardware parameters:
- OS type:
- Others:
Actual Behavior
job:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/7411109762/job/20165058520
mo not oom,but mem almost fully occupied
mo log:reported error time is 03:52:41 molog.tar.gz
Expected Behavior
No response
Steps to Reproduce
standalone regression sysbench 1000w test
Additional information
No response
通过任务https://github.com/matrixorigin/mo-nightly-regression/actions/runs/7411109762/job/20165058520可以得到以下信息:
1. 04 Jan 2024 19:48:15 GMT drop了sbtest相关的表并且重建
2. 04 Jan 2024 19:52:41 GMT 遇到了SQL parser error: table "sbtest5" does not exist
通过分析日志可以看到sbtest5确实是在19:48:15 GM重建成功,对应的日志如下:
58277:{"level":"INFO","time":"2024/01/05 03:48:15.662135 +0800","caller":"rpc/handle.go:848","msg":"[precommit] drop/truncate relation: &{IsDrop:true DatabaseID:272471 DatabaseName:sysbench_db Name:sbtest5 ID:272557 NewId:0} txn: ctx[0ABE8A770B424430935F97EFE0F964B5][1704397695660262961-1->9223372036854775807-4294967295][Active]: <nil>"}
58408:{"level":"INFO","time":"2024/01/05 03:48:15.815105 +0800","caller":"disttae/tools.go:833","msg":"precommit: create table: 99c259130a26478284ba07f69316a265/Active/S:1704397695812159800-1-[sbtest5]"}
58409:{"level":"INFO","time":"2024/01/05 03:48:15.815413 +0800","caller":"rpc/handle.go:657","msg":"create table: sysbench_db.sbtest5\n"}
58410:{"level":"INFO","time":"2024/01/05 03:48:15.815471 +0800","caller":"rpc/handle.go:816","msg":"[precommit] create relation: {AccountID:0 UserID:1 RoleID:0}, 272471-sysbench_db:272567-sbtest5 txn: ctx[99C259130A26478284BA07F69316A265][1704397695812159800-1->9223372036854775807-4294967295][Active]: <nil>"}
具体的报错日志如下:
61416:{"level":"ERROR","time":"2024/01/05 03:52:41.169111 +0800","caller":"plan/query_builder.go:3448","msg":"error: SQL parser error: table \"sbtest5\" does not exist","span":{"trace_id":"03e0d249-e6b5-b0cc-7fd9-dcad2b8eef09","span_id":"af33b946a4cc56a4"}}
61417:{"level":"ERROR","time":"2024/01/05 03:52:41.169186 +0800","name":"log-service.frontend","caller":"frontend/mysql_cmd_executor.go:2820","msg":"SQL parser error: table \"sbtest5\" does not exist","uuid":"7c4dccb4-4d3c-41f8-b482-5251dc7a41bf","session_info":"connectionId 6068|127.0.0.1:54870|{account sys:dump:moadmin -- 0:1:0}|goRoutineId 7485166|70177d36-ab3a-11ee-9773-b07b25f8b524","session_id":"70177d36-ab3a-11ee-9773-b07b25f8b524","statement_id":"d1cc9e38-ab3a-11ee-9773-b07b25f8b524","txn_id":"bfaf62295f66438b9187f7d94dfcbb8e/Aborted/S:1704397856935097425-1"}
61418:{"level":"ERROR","time":"2024/01/05 03:52:41.169368 +0800","name":"log-service.frontend","caller":"frontend/util.go:511","msg":"query trace status","uuid":"7c4dccb4-4d3c-41f8-b482-5251dc7a41bf","connection_id":6068,"statement":"SELECT c FROM sbtest5 WHERE id BETWEEN 4999064 AND 4999163 ORDER BY c","status":"fail","error":"SQL parser error: table \"sbtest5\" does not exist","span":{"trace_id":"03e0d249-e6b5-b0cc-7fd9-dcad2b8eef09","span_id":"af33b946a4cc56a4"},"session_info":"connectionId 6068|127.0.0.1:54870|{account sys:dump:moadmin -- 0:1:0}|goRoutineId 7485166|70177d36-ab3a-11ee-9773-b07b25f8b524","session_id":"70177d36-ab3a-11ee-9773-b07b25f8b524","statement_id":"d1cc9e38-ab3a-11ee-9773-b07b25f8b524"}
分析代码可以得到https://github.com/matrixorigin/matrixone/blob/main/pkg/sql/plan/query_builder.go#L3448处报错的,这个错误实际是由https://github.com/matrixorigin/matrixone/blob/main/pkg/frontend/compiler_context.go#L293或者https://github.com/matrixorigin/matrixone/blob/main/pkg/frontend/compiler_context.go#L298报出的,可以看到293和298实际是丢失了真实的错误,目前的错误只是一个构造的错误,实际错误可能和表存不存在没什么关系。麻烦 @daviszhen 修改一下代码,在这种情况下不应该丢弃错误信息,如果实在需要丢弃,可以选择输出一条ERROR日志,然后在构造一个统一的错误信息
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
先关闭,等出现后在提issue跟踪