matrixorigin / matrixone

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

[Bug]: CN fail to report duplicate #20251

Open jensenojs opened 17 hours ago

jensenojs commented 17 hours ago

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

lastest

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

TN report error

Expected Behavior

No response

Steps to Reproduce

select mo_ctl('cn', 'task', 'disable');
drop database if exists db1;
create database db1;
use db1;
create table t0 (
  a int,
  b int,
  c varchar(20),
  primary key(a, b)
);
insert into t0 select result, result, result || 'test' from generate_series(1, 100) g;
set experimental_fulltext_index=1;
create fulltext index ftidx on t0 (c);
create table t1 (
  a int,
  b int,
  c varchar(20),
  primary key(a, b)
);

set experimental_fulltext_index=1;
create fulltext index ftidx on t1 (c);

use db1;
insert into t1 select * from t0 where a = 1 and b = 1;
insert into t1 select * from t0 where a = 1 and b = 1; -- should CN report error

Additional information

No response

jensenojs commented 17 hours ago

之前的诊断, fuzzy filter收不到table scan的数据, 其原因是在于中间的filter算子把所有的数据都给过滤掉了

Pasted Graphic

进一步诊断原因是filter使用的表达式有误, table scan t1时拿的数据是a, b, __mo_cpkey_col三列.

image

而filter使用的Index并不正确.

image
jensenojs commented 14 hours ago
image