Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: create FULLTEXT INDEX on table(has many data) failed #19923

Open
1 task done
tom-csf opened this issue Nov 11, 2024 · 6 comments · May be fixed by #20055
Open
1 task done

[Bug]: create FULLTEXT INDEX on table(has many data) failed #19923

tom-csf opened this issue Nov 11, 2024 · 6 comments · May be fixed by #20055
Assignees
Labels
kind/bug Something isn't working severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Milestone

Comments

@tom-csf
Copy link

tom-csf commented Nov 11, 2024

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

9a8c097

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

image

Expected Behavior

No response

Steps to Reproduce

1、load tpch 10g data to mo
2、set experimental_fulltext_index=1;
CREATE FULLTEXT INDEX ftidx ON lineitem(l_comment);

Additional information

image
@tom-csf tom-csf added kind/bug Something isn't working needs-triage severity/s0 Extreme impact: Cause the application to break down and seriously affect the use labels Nov 11, 2024
@tom-csf tom-csf added this to the 2.0.1 milestone Nov 11, 2024
@ouyuanning
Copy link
Contributor

多CN报错的复现方式

select mo_ctl('cn', 'task', 'disable');
drop database if exists db1;
create database db1;
use db1;

set experimental_fulltext_index=1;
drop table if exists t1;
create table t1(a int primary key, b varchar(200));
insert into t1 select result, "test create big fulltext index" from generate_series(3000000) g;  //如果把这里的数据量变小,后面的就不会报错,比如300000
create fulltext index ftidx on t1 (b); //这里会报错,

报错是这个地方
image
直接原因是601行的判断,进不去。

@ouyuanning ouyuanning assigned aptend and unassigned tom-csf Nov 13, 2024
cpegeric added a commit to cpegeric/matrixone that referenced this issue Nov 13, 2024
@aptend
Copy link
Contributor

aptend commented Nov 14, 2024

报错的表 _mo_index_secondary* 没有被创建过,Relation 接口返回找不到表是预期行为。需要关注索引表的创建逻辑

@aptend aptend assigned qingxinhome and unassigned aptend Nov 14, 2024
@qingxinhome
Copy link
Contributor

定位分析中

@qingxinhome
Copy link
Contributor

执行创建索引语句时,会有一下步骤:

  1. 检查索引表名是否已经存在,如果存在就报错, 如果不存在就执行步骤2
  2. 调用txnDatabase.Create()接口方法,在当前事务中创建索引表对应的relation
  3. 如果索引表有自增列,自增列表中插入自增列信息
  4. 往索引表中填入数据, 构建insert into select * from语句,通过调用TxnExecutor内部执行器,执行该insert语句
    以上步骤全部成功后,索引即可创建成功

通过日志分析,发现步骤1,步骤2,步骤3均已执行成功,但是执行步骤4时失败报错,也就是说,索引表的表结构创建成功了,但是
往索引表中insert数据时报错,
通过日志看到,内部执行器在运行insert into select的物理计划时, 执行preinsert算子报错了,
原因是在生成自增列值的过程中无法找到对应的表id, 如下图所示
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Projects
None yet
6 participants