You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: fulltext index search 500 threads report 'Communications link failure'. #21418
1.
CREATE TABLE `test` (
`id` int NOT NULL,
`title` varchar(255) DEFAULT NULL,
`content` text DEFAULT NULL,
PRIMARY KEY (`id`),
FULLTEXT `f01`(`content`)
);
load data local infile '/root/weilu/zhwiki-latest-pages-articles-multistream6.xml-p7096380p8596379.csv' into table test fields terminated by ',' enclosed by '"' escaped by '';
2.
cd mo-load/cases/fulltext
vi case.yml
name: "fulltext_test"
runMins: 5
runTimes: 0
transaction:
- name: "fulltext_test"
terminal: 10
scripts:
- sql: "SELECT * from test.test where match(content) against ('{str1}' in natural language mode) order by id desc limit 100;"
vi replace.yml
replace:
- name: str1
type: file
path: /root/weilu/mo-load/replace/temp_fulltext_output.txt
dtype: "varchar"
./run.sh -c cases/fulltext -b test -t 500
load file and temp_fulltext_output.txt, please contact me privately.
1.
CREATE TABLE `test` (
`id` int NOT NULL,
`title` varchar(255) DEFAULT NULL,
`content` text DEFAULT NULL,
PRIMARY KEY (`id`),
FULLTEXT `f01`(`content`)
);
load data local infile '/root/weilu/zhwiki-latest-pages-articles-multistream6.xml-p7096380p8596379.csv' into table test fields terminated by ',' enclosed by '"' escaped by '';
2.
cd mo-load/cases/fulltext
vi case.yml
name: "fulltext_test"
runMins: 5
runTimes: 0
transaction:
- name: "fulltext_test"
terminal: 10
scripts:
- sql: "SELECT * from test.test where match(content) against ('{str1}' in natural language mode) order by id desc limit 100;"
vi replace.yml
replace:
- name: str1
type: file
path: /root/weilu/mo-load/replace/keyword_100.txt
dtype: "varchar"
./run.sh -c cases/fulltext -b test -t 500
load file and keyword_100.txt, please contact me privately.
-- 测试的sql
SELECT * from test where match(content) against ('是' in natural language mode) order by id desc limit 100;
-- 其中fulltext内部执行的sql:
SELECT COUNT(*), AVG(pos) from `db1`.`__mo_index_secondary_01956eb3-20aa-79ac-bf87-2f8ce7ea5d59` where word = '__DocLen'; -- 拿doc len,排序算法用
SELECT doc_id, CAST(0 as int) FROM `db1`.`__mo_index_secondary_01956eb3-20aa-79ac-bf87-2f8ce7ea5d59` WHERE prefix_eq(word,'是'); -- 拿包含”是“的doc_id列表
测试步骤:
1.
CREATE TABLE `test` (
`id` int NOT NULL,
`title` varchar(255) DEFAULT NULL,
`content` text DEFAULT NULL,
PRIMARY KEY (`id`),
FULLTEXT `f01`(`content`)
);
load data local infile '/root/weilu/zhwiki-latest-pages-articles-multistream6.xml-p7096380p8596379.csv' into table test fields terminated by ',' enclosed by '"' escaped by '';
2.
cd mo-load/cases/fulltext
vi case.yml
name: "fulltext_test"
runMins: 5
runTimes: 0
transaction:
- name: "fulltext_test"
terminal: 10
scripts:
- sql: "SELECT * from test.test where match(content) against ('{str1}' in natural language mode) order by id desc limit 100;"
vi replace.yml
replace:
- name: str1
type: file
path: /root/weilu/mo-load/replace/temp_fulltext_output.txt
dtype: "varchar"
./run.sh -c cases/fulltext -b test -t 500
load file and temp_fulltext_output.txt, please contact me privately.
Activity
Ariznawlll commentedon Feb 24, 2025
repro:
commit:35b8ac3f37723e1ae7a0d3fe1b08d6fda0657e71
oom:

load file and keyword_100.txt, please contact me privately.
heap profile:
heap_profile0224-2.zip
malloc profile:
malloc_profile0224-2.zip
log:https://shanghai.idc.matrixorigin.cn:30001/explore?panes=%7B%22_Z-%22:%7B%22datasource%22:%22loki%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bhost%3D%5C%2210-222-1-129%5C%22%7D%20%7C%3D%20%60%60%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22loki%22%7D,%22editorMode%22:%22builder%22%7D%5D,%22range%22:%7B%22from%22:%221740378300000%22,%22to%22:%221740379020000%22%7D%7D%7D&schemaVersion=1&orgId=1
ouyuanning commentedon Mar 7, 2025
本地跑了一下。50线程的。
堆内内存占用:
对外内存占用:
ouyuanning commentedon Mar 7, 2025
该测试中,总共会执行的sql如下(假设搜索的”是“这个字符):
这3个SQL之后第一个SQL有join,起执行计划如下:
内存占用大的根本原因是:
1、Table Scan on db1.test 拿的数据较多。 这里有4606行
2、这个是select * ,而该表的 content 列是测试的字符串,这个列较大
测试看MO在join没有内存泄露。暂时没有太好的方法优化这种情况下join的内存占用。建议测试SQL修改为:
没有order by的话,优化器可以让join只拿尽量少的数据,以减少内存占用
ouyuanning commentedon Mar 7, 2025
应该还有另外一个问题就是 select * 返回的内容太多了。数据传输也太多。因为我测试
tps也是0,根本跑步上去。
tps可以跑到5200左右。
所以可能建议这样测:(虽然tps也很差,但是这样起码应该是fulltext的问题了)
Ariznawlll commentedon Mar 12, 2025
复测还是有问题:
commit:e186e1c
log:https://shanghai.idc.matrixorigin.cn:30001/explore?panes=%7B%22GYP%22:%7B%22datasource%22:%22loki%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bhost%3D%5C%2210-222-1-129%5C%22%7D%20%7C%3D%20%60mpool%20memory%20allocation%20exceed%60%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22loki%22%7D,%22editorMode%22:%22builder%22%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D%7D&schemaVersion=1&orgId=1
ouyuanning commentedon Mar 14, 2025
已经跟#21414一起处理
Ariznawlll commentedon May 30, 2025
main commit:5cc42fe