matrixorigin / matrixone

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

[Bug]: Snapshot read return “an error has occurred about table subscription” #17012

Closed LeftHandCold closed 3 months ago

LeftHandCold commented 3 months ago

Is there an existing issue for the same bug?

Branch Name

1.2-dev

Commit ID

cc6c65b34dc2e9d256be098bab1aede10317f8ee

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

MySQL [(none)]> show snapshots; +---------------+-------------------------------+----------------+--------------+---------------+------------+ | SNAPSHOT_NAME | TIMESTAMP | SNAPSHOT_LEVEL | ACCOUNT_NAME | DATABASE_NAME | TABLE_NAME | +---------------+-------------------------------+----------------+--------------+---------------+------------+ | snapshot_5 | 2024-06-19 09:35:09.112973616 | account | sys | | | | snapshot_3 | 2024-06-19 08:51:51.819956264 | account | tpcc_admin1 | | | | snapshot_2 | 2024-06-19 08:51:45.731888586 | account | tpcc_admin2 | | | | snapshot_1 | 2024-06-19 08:51:39.366375503 | account | tpcc_admin3 | | | +---------------+-------------------------------+----------------+--------------+---------------+------------+ 4 rows in set (0.064 sec)

MySQL [(none)]> select count() from sysbench_db.sbtest1 {snapshot = 'snapshot_5'}; ERROR 20101 (HY000): internal error: an error has occurred about table subscription, please try again. MySQL [(none)]> select count() from sysbench_db.sbtest1 {snapshot = 'snapshot_5'}; ERROR 20101 (HY000): internal error: an error has occurred about table subscription, please try again. MySQL [(none)]>

Expected Behavior

No response

Steps to Reproduce

run mo-service
create table1 and load data to table1
create snapshot1
drop table1
2 hour after
select count(*) from table1

Additional information

No response

Ariznawlll commented 3 months ago

main commit: eb1f0f578faab5fc7f977c23a3a99b9e62580186

测试前准备: 单机环境在tn.toml里面加上配置:

[tn.Ckp]
flush-interval = "10s"
min-count = 100
scan-interval = "5s"
incremental-interval = "30s"
global-min-count = 9

[tn.GCCfg]
gc-ttl = "5m"
scan-gc-interval = "2m"
check-gc = true

并对应修改代码配置:(收集5min中内的过期数据)

配置目录:/Users/ariznawl/matrixone/pkg/vm/engine/tae/options/types.go

image
测试步骤:
create table_with_pk_index_for_load_100m and load data;
create snapshot1 sp01 for account sys;
drop table table_with_pk_index_for_load_100m;
2 hour after
select count(*) from table_with_pk_index_for_load_100m{snapshot = 'sp01'};

测试结果:

image

测试通过