4paradigm / 4paradigm/OpenMLDB

router error improvements

未关闭
#2,741 2 条评论 0 个 reaction 已指派 1 人 已被 @vagetablechicken 认领 在 GitHub 查看
enhancement
主要语言
C++
星标
1.7k
派生
331
平均合并
12 天 12 小时
30 天内合并 PR
1

描述

- [x] prepend status from inner funcs or create new status, warn if not ok
no missing msg(if inner funcs won't return the status, warn the error)

1. the only entrance in sql_client is ExecuteSQL

```
127.0.0.1:7125/db> drop table t1;
Drop table t1? yes/no
yes
W1031 09:35:20.973491 40419 sql_cluster_router.cc:984] Status: fail to drop, table is not exist!
Error: fail to drop, table is not exist!
```
We can find the error position by line no in logs.
- [x] error code, we can use error code to know "who's error, what kind of error"
If we don't have log, the status code & message is useful(prepend/append can help us to find the error position)
e.g.
```
» build/bin/openmldb --zk_cluster=127.0.0.1:8181 --zk_root_path=/hw --role=sql_client --glog_level=3
_____ ______ _ _____ ______
/ ___ \ | ___ \| | (____ \ (____ \
| | | |____ ____ ____ | | _ | | | _ \ \ ____) )
| | | | _ \ / _ ) _ \| || || | | | | | | __ (
| |___| | | | ( (/ /| | | | || || | |_____| |__/ /| |__) )
\_____/| ||_/ \____)_| |_|_||_||_|_______)_____/ |______/
|_|

v0.6.5-83fbcc77c
127.0.0.1:7125/> use db;
SUCCEED: Database changed
127.0.0.1:7125/db> select * from t1;
Error: [2001] async offline query failed--ReturnCode[1003]--Fail to get TaskManager client
127.0.0.1:7125/db>
```
`[2001]` code is not useful, the real status code is `ReturnCode[1003]`(but it's openmldb base status code, not the hybridse sdk status, so we encode it in sdk status error msg), we can get it. We should check the code sheet of openmldb base status.

- [ ] error code sheet, add the sheet link in error message?--Need to collect.
- [x] message typo. e.g. table is not exist -> table doesn't exist
- [ ] if offline jobs got error, we must check the log file. It's very inconvenient. How about show the exception in resultset or python_tool helps?

贡献指南

打开贡献指南

调研方向

The issue mentions sql_cluster_router.cc and error handling in ExecuteSQL. Start by examining the router's error propagation, especially how status codes from inner functions are wrapped. Look at the openmldb base status code definitions and the hybridse sdk. The goal is to improve error messages and codes, and possibly create an error code sheet. Check logs for current error output patterns.

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp, sql
领域
backend, databases
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。