4paradigm / 4paradigm/OpenMLDB

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

Đang mở
#3,368 1 bình luận 0 reaction 1 người được giao Được @aceforeverd nhận Xem trên GitHub
bug execute-engine high-priority
Ngôn ngữ chính
C++
Star
1.7k
Fork
331
Merge trung bình
12 ngày 12 giờ
Pull request đã merge (30 ngày)
1

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
sql
Lĩnh vực
backend, databases
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.