4paradigm / 4paradigm/OpenMLDB
external registered functions: registered fn with wrong signatures cores the whole tablet
- Lingua principale
- C++
- Stelle
- 1.7k
- Fork
- 331
- Merge medio
- 12g 12h
- PR unite (30g)
- 1
Descrizione
Key point:
- writing the function with C signature: `void fn(StringRef*, int, StringRef*, StringRef*, bool*)`
- It is able to create function as `create function list_at(string, int, string) returns string options (FILE = 'liblist_at.so')`
- But cores tablet during query executing
Correct way to this fn is `create function list_at(string, int, string) returns string options (FILE = 'liblist_at.so', RETURN_NULLABLE = true)`, but cores tablet is not acceptable.
```
127.0.0.1:9622/db> create function list_at(string, int, string) returns string options (FILE = 'liblist_at.so');
W0716 13:14:13.724938 39027 db_sdk.cc:291] fail to get zk value with path /onebox/taskmanager/leader
E0716 13:14:13.724973 39027 db_sdk.cc:66] fail to get TaskManager address
SUCCEED
127.0.0.1:9622/db> select id, list_at(val, 1, ',') as out from t1;
W0716 13:16:16.365479 39027 rpc_client.h:122] request error. [E1014]Got EOF of Socket{id=0 fd=12 addr=127.0.0.1:9520:46740} (0x0x55799394e000) [R1][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R2][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R3][E112]Not connected to 127.0.0.1:9520 yet, server_id=0
W0716 13:16:16.365582 39027 tablet_client.cc:94] send rpc request failed
W0716 13:16:16.365602 39027 sql_cluster_router.cc:1255] Status: [1500] Query rpc failed--[E1014]Got EOF of Socket{id=0 fd=12 addr=127.0.0.1:9520:46740} (0x0x55799394e000) [R1][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R2][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R3][E112]Not connected to 127.0.0.1:9520 yet, server_id=0--ReturnCode[0]--
Error: [1500] Query rpc failed--[E1014]Got EOF of Socket{id=0 fd=12 addr=127.0.0.1:9520:46740} (0x0x55799394e000) [R1][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R2][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R3][E112]Not connected to 127.0.0.1:9520 yet, server_id=0--ReturnCode[0]--
127.0.0.1:9622/db> show components;
---------------- ------------ --------------------- --------- ---------
Endpoint Role Connect_time Status Ns_role
---------------- ------------ --------------------- --------- ---------
127.0.0.1:9520 tablet 2023-07-16 21:16:21 offline NULL
127.0.0.1:9521 tablet 2023-07-16 19:21:36 online NULL
127.0.0.1:9522 tablet 2023-07-16 19:21:36 online NULL
127.0.0.1:9622 nameserver 2023-07-16 19:21:37 online master
127.0.0.1:9623 nameserver 2023-07-16 19:21:39 online standby
127.0.0.1:9624 nameserver 2023-07-16 19:21:41 online standby
---------------- ------------ --------------------- --------- ---------
6 rows in set
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
The issue involves external registered functions in OpenMLDB. Look at the function registration code, likely in a file handling UDFs or external functions. The bug is that a function with a C signature mismatch causes a tablet crash instead of a proper error. Examine how function signatures are validated during CREATE FUNCTION and execution. Check the tablet server logs and the code path for executing external functions to see where the crash occurs. The fix should validate the signature or handle the mismatch gracefully.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- sql
- Ambito
- backend, databases
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100