4paradigm / 4paradigm/OpenMLDB

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

オープン
#3,368 コメント 1 件 リアクション 0 件 担当者 1 名 @aceforeverd が担当を希望しています GitHub で見る
bug execute-engine high-priority
主要言語
C++
スター
1.7k
フォーク
331
平均マージ
12日 12時間
マージ済み PR(30日)
1

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
sql
領域
backend, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。