matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 276 forks source link

[Bug]: [date 9.6] standalone regression: vector index query reported panic error : index out of range [3] with length 3 #18623

Closed heni02 closed 1 month ago

heni02 commented 2 months ago

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

0eba06817ae743e8658beb7cbe9e1f4743d550f2

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

job:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/10740444396/job/29788836653 image

panic error: internal error: panic runtime error: index out of range [3] with length 3: \nruntime.goPanicIndex\n\t/data1/runners/action-runner/_work/_tool/go/1.23.0/x64/src/runtime/panic.go:115\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/projection.(Projection).Call\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/colexec/projection/projection.go:85\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/semi.(SemiJoin).Call\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/colexec/semi/join.go:99\ngithub.com/matrixorigin/matrixone/pkg/vm.ChildrenCall\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/vm/types.go:258\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/top.(Top).Call\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/colexec/top/top.go:116\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/connector.(Connector).Call\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/colexec/connector/connector.go:47\ngithub.com/matrixorigin/matrixone/pkg/vm/pipeline.(Pipeline).run\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/vm/pipeline/pipeline.go:80\ngithub.com/matrixorigin/matrixone/pkg/vm/pipeline.(Pipeline).Run\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/vm/pipeline/pipeline.go:59\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(Scope).Run\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/compile/scope.go:176\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(Scope).MergeRun.func1\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/compile/scope.go:241\ngithub.com/panjf2000/ants/v2.(*goWorker).run.func1\n\t/home/github/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67\nruntime.goexit\n\t/data1/runners/action-runner/_work/_tool/go/1.23.0/x64/src/runtime/asm_amd64.s:1700')

Expected Behavior

No response

Steps to Reproduce


create database if not exists vector_index;use vector_index;create table vector_128dim(a int primary key, b vecf32(128));
source /data1/mo-benchmark-test/sift128_with_pk.sql (contact me)
SET  experimental_ivf_index = 1;
create index idx_500 using ivfflat on vector_index.vector_128dim(b) lists=500 op_type "vector_l2_ops";
SELECT a FROM vector_128dim ORDER BY l2_distance(b,'[24.0,12.0,14.0,8.0,3.0,12.0,4.0,8.0,8.0,12.0,20.0,17.0,8.0,67.0,66.0,8.0,8.0,8.0,1.0,0.0,0.0,18.0,119.0,32.0,12.0,4.0,7.0,8.0,1.0,18.0,70.0,20.0,18.0,35.0,23.0,25.0,103.0,34.0,4.0,5.0,1.0,1.0,4.0,29.0,119.0,119.0,77.0,6.0,72.0,7.0,5.0,2.0,0.0,14.0,119.0,60.0,119.0,12.0,8.0,3.0,0.0,1.0,18.0,38.0,7.0,6.0,8.0,27.0,84.0,53.0,22.0,6.0,0.0,6.0,60.0,119.0,104.0,11.0,0.0,0.0,42.0,104.0,119.0,25.0,0.0,0.0,0.0,7.0,119.0,98.0,23.0,0.0,5.0,20.0,6.0,11.0,6.0,7.0,14.0,7.0,6.0,6.0,12.0,25.0,4.0,7.0,68.0,91.0,2.0,0.0,1.0,8.0,3.0,87.0,97.0,17.0,4.0,30.0,8.0,0.0,1.0,39.0,15.0,0.0,14.0,103.0,16.0,0.0]') ASC LIMIT 100;

Additional information

No response

heni02 commented 2 months ago

正在二分中

heni02 commented 2 months ago

二分结果,#18549是有问题的pr, cc @badboynt1

企业微信截图_fc57cf15-f1c2-47bb-b729-e39ad93519a4
badboynt1 commented 2 months ago

是top算子的问题,没有创建索引是,执行计划是scan->top,没有join 问题更容易复现。 麻烦 @ouyuanning 看一下

heni02 commented 2 months ago

最新的main还是有panic错误 job:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/10805915922/job/29973960973

sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (20101, 'internal error: panic runtime error: index out of range [2] with length 2: \nruntime.goPanicIndex\n\t/data1/runners/action-runner/_work/_tool/go/1.23.0/x64/src/runtime/panic.go:115\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/projection.(Projection).Call\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/colexec/projection/projection.go:90\ngithub.com/matrixorigin/matrixone/pkg/vm.ChildrenCall\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/vm/types.go:380\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/semi.(SemiJoin).Call\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/colexec/semi/join.go:106\ngithub.com/matrixorigin/matrixone/pkg/vm.ChildrenCall\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/vm/types.go:380\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/top.(Top).Call\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/colexec/top/top.go:116\ngithub.com/matrixorigin/matrixone/pkg/vm.ChildrenCall\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/vm/types.go:380\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/connector.(Connector).Call\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/colexec/connector/connector.go:56\ngithub.com/matrixorigin/matrixone/pkg/vm/pipeline.(Pipeline).run\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/vm/pipeline/pipeline.go:80\ngithub.com/matrixorigin/matrixone/pkg/vm/pipeline.(Pipeline).Run\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/vm/pipeline/pipeline.go:59\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(Scope).Run\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/compile/scope.go:178\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(Scope).MergeRun.func1\n\t/data1/runners/action-runner/_work/mo-nightly-regression/mo-nightly-regression/head/pkg/sql/compile/scope.go:243\ngithub.com/panjf2000/ants/v2.(*goWorker).run.func1\n\t/home/github/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67\nruntime.goexit\n\t/data1/runners/action-runner/_work/_tool/go/1.23.0/x64/src/runtime/asm_amd64.s:1700') [SQL: SELECT a FROM vector_128dim ORDER BY l2_distance(b,'[24.0,12.0,14.0,8.0,3.0,12.0,4.0,8.0,8.0,12.0,20.0,17.0,8.0,67.0,66.0,8.0,8.0,8.0,1.0,0.0,0.0,18.0,119.0,32.0,12.0,4.0,7.0,8.0,1.0,18.0,70.0,20.0,18.0,35.0,23.0,25.0,103.0,34.0,4.0,5.0,1.0,1.0,4.0,29.0,119.0,119.0,77.0,6.0,72.0,7.0,5.0,2.0,0.0,14.0,119.0,60.0,119.0,12.0,8.0,3.0,0.0,1.0,18.0,38.0,7.0,6.0,8.0,27.0,84.0,53.0,22.0,6.0,0.0,6.0,60.0,119.0,104.0,11.0,0.0,0.0,42.0,104.0,119.0,25.0,0.0,0.0,0.0,7.0,119.0,98.0,23.0,0.0,5.0,20.0,6.0,11.0,6.0,7.0,14.0,7.0,6.0,6.0,12.0,25.0,4.0,7.0,68.0,91.0,2.0,0.0,1.0,8.0,3.0,87.0,97.0,17.0,4.0,30.0,8.0,0.0,1.0,39.0,15.0,0.0,14.0,103.0,16.0,0.0]') ASC LIMIT 100;]

ouyuanning commented 1 month ago

已提PR

ouyuanning commented 1 month ago

等18743合并后再观察一下

heni02 commented 1 month ago

confirm,closed commit:48304fdb79f5d6486706f9a4cc965b83781c9c01 https://github.com/matrixorigin/mo-nightly-regression/actions/runs/10903140510/job/30256594212