4paradigm / 4paradigm/OpenMLDB

external registered functions: registered fn with wrong signatures cores the whole tablet

Ouverte
#3,368 1 commentaire 0 réactions 1 personne assignée Réclamée par @aceforeverd Voir sur GitHub
bug execute-engine high-priority
Langage dominant
C++
Étoiles
1.7k
Forks
331
Merge moyen
12 j 12 h
PR mergées (30 j)
1

Description

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
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
sql
Domaine
backend, databases
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.