4paradigm / 4paradigm/OpenMLDB

router error improvements

オープン
#2,741 コメント 2 件 リアクション 0 件 担当者 1 名 @vagetablechicken が担当を希望しています GitHub で見る
enhancement
主要言語
C++
スター
1.7k
フォーク
331
平均マージ
12日 12時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。