4paradigm / 4paradigm/OpenMLDB
router error improvements
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 331
- Avg merge
- 12d 12h
- Merged PRs (30d)
- 1
Description
- [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?
Contributor guide
Assessment
This issue has not been assessed yet.