4paradigm / OpenMLDB

OpenMLDB is an open-source machine learning database that provides a feature platform computing consistent features for training and inference.
https://openmldb.ai
Apache License 2.0
1.59k stars 316 forks source link

router error improvements #2741

Open vagetablechicken opened 1 year ago

vagetablechicken commented 1 year ago
  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.

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?
vagetablechicken commented 1 year ago

ExecuteSQL:

openmldb::base::Status error code != hybridse::xx:Status: use kServerError means use openmldb::base::ReturnCode not hybridse::common::StatusCode

kCmdError means sql can't be executed, it'll ok if use the right sql kRuntimeError retry may work

hybridse::base::Status -> hybridse::sdk::Status error code is the same, but not a same class, do convert

vagetablechicken commented 1 year ago

insert multi values in sql, e.g. 'insert into t1 values(1).(2),('a')', can't figure out which row is failed to insert. 'success/total' is not useful.