matrixorigin / matrixone

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

[Bug]: bvt/result_count failed: 2 more rows result #16530

Open xzxiong opened 1 month ago

xzxiong commented 1 month ago

Is there an existing issue for the same bug?

Branch Name

main, 1.2-dev

Commit ID

3b0325c1c, 5085e5900

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

https://github.com/matrixorigin/matrixone/actions/runs/9306467231/job/25616635121

2024-05-30 17:53:45 INFO Executor:37 - Start to execute the script file[/home/runner/_work/matrixone/matrixone/matrixone/test/distributed/cases/zz_statement_query_type/result_count.sql] now, and it will take a few moment,pleas wait...... 2024-05-30 17:53:45 ERROR RSRow:83 - The value of [row:49,column:0] does not equal with each other,one is [commit],but the other is [create database db1] 2024-05-30 17:53:45 ERROR Executor:199 - [/home/runner/_work/matrixone/matrixone/matrixone/test/distributed/cases/zz_statement_query_type/result_count.sql][row:11][select statement, result_count from statement_info where account="bvt_result_count" and statement not like '%mo_ctl%' and length(statement) > 0 and status != 'Running' and aggr_count < 1 order by request_at desc limit 50;] was executed failed, con[id=0, user=dump, ***

企业微信截图_fb66ea9a-e80c-482d-9be0-0bac2fa715af

Expected Behavior

No response

Steps to Reproduce

run MatrixOne CI

Additional information

No response

xzxiong commented 1 month ago

main repro https://github.com/matrixorigin/matrixone/actions/runs/9301220736?pr=16474

xzxiong commented 1 month ago

root cause: case 设计问题,多出来的 2行都是 insert 语句,按聚合逻辑是有可能被聚合,也有可能不被聚合 —— 结果不稳定。

xzxiong commented 1 month ago

为了保证 不被聚合,有以下几种方式:

  1. /*cloud_user*/ 保证一定不会被聚合。
  2. 用 bvt tag -- @session:id=.... 隔离到不同的 session 下。
xzxiong commented 1 month ago

采用 hint /*cloud_user*/ 解决问题

xzxiong commented 1 month ago

ref: https://github.com/matrixorigin/matrixone/issues/14836

daviszhen commented 1 month ago

https://github.com/matrixorigin/ci-test/actions/runs/9319469691/job/25654986820

image

xzxiong commented 1 month ago

https://github.com/matrixorigin/ci-test/actions/runs/9319469691/job/25654986820

我仔细看了下,整个 result_count 的case 很难控制: statement_info 聚合逻辑 V.S. 预期的query history 我准备通过一下方式解决:

  1. [x] 需要先屏蔽该bvt
  2. [ ] 支持一个 session variable控制,当前session 是否进行聚合操作。

在解决前,可能需要先重试该case

xzxiong commented 1 month ago

下个迭代

xzxiong commented 1 month ago

Not plan yet

xzxiong commented 1 month ago

Not plan yet

xzxiong commented 1 month ago

Not plan yet

xzxiong commented 1 week ago

repro: https://github.com/matrixorigin/matrixone/actions/runs/9870656005/job/27257000560?pr=17454 image

[/home/runner/work/matrixone/matrixone/upstream/test/distributed/cases/zz_statement_query_type/statement_query_type_1.sql] SQL: select statement,query_type,sql_source_type from  system.statement_info where account="bvt_query_type_part1" and sql_source_type="external_sql" and status != "Running" and statement not like '%mo_ctl%' and aggr_count <1 order by request_at desc limit 96;
xzxiong commented 1 week ago

https://github.com/matrixorigin/ci-test/actions/runs/9319469691/job/25654986820

我仔细看了下,整个 result_count 的case 很难控制: statement_info 聚合逻辑 V.S. 预期的query history 我准备通过一下方式解决:

  1. [x] 需要先屏蔽该bvt
  2. [ ] 支持一个 session variable控制,当前session 是否进行聚合操作。

在解决前,可能需要先重试该case

在 1.3.0 中,计划支持 mo_ctl 可以关闭当前 session 的 statement的聚合逻辑 ==> 保障 bvt 的验证,不用考虑聚合的行为来编辑case