4paradigm / 4paradigm/OpenMLDB

router error improvements

Aperta
#2,741 2 commenti 0 reazioni 1 assegnatario Rivendicata da @vagetablechicken Vedi su GitHub
enhancement
Lingua principale
C++
Stelle
1.7k
Fork
331
Merge medio
12g 12h
PR unite (30g)
1

Descrizione

- [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?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, sql
Ambito
backend, databases
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.