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]: Inconsistent table rows and size for the same account #16615

Open
1 task done
DanielZhangQD opened this issue Jun 4, 2024 · 3 comments
Open
1 task done

[Bug]: Inconsistent table rows and size for the same account #16615

DanielZhangQD opened this issue Jun 4, 2024 · 3 comments
Assignees
Labels
kind/bug Something isn't working severity/s1 High impact: Logical errors or data errors that must occur to-next-release
Milestone

Comments

@DanielZhangQD
Copy link
Contributor

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

1.2-dev

Commit ID

v1.2.0-91b0ae027-2024-06-03

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

  • Create a new account a
  • Check the table rows and size in the mo_catalog database:
SELECT account_id,relname AS `name`, mo_table_rows(reldatabase, relname) AS `rows`, mo_table_size(reldatabase, relname) AS `size`, if (role_name IS NULL, '-', role_name) AS `owner`, mo_tables.created_time AS created FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('r','e','cluster') AND reldatabase='mo_catalog' Order by name;
  • Check the table rows and size in the mo_catalog database for the same account with dump user:
SELECT account_id,relname AS `name`, mo_table_rows(reldatabase, relname) AS `rows`, mo_table_size(reldatabase, relname) AS `size`, if (role_name IS NULL, '-', role_name) AS `owner`, mo_tables.created_time AS created FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('r','e','cluster') AND reldatabase='mo_catalog' and (account_id = 600330002) Order by name;
  • The results for the above two steps are different
企业微信截图_576b1d50-aa2b-4950-9ef3-8030530e2e53

Expected Behavior

The result in the user account and the sys account should be same

Steps to Reproduce

See detail in Actual Behavior

Additional information

No response

@DanielZhangQD DanielZhangQD added kind/bug Something isn't working needs-triage severity/s1 High impact: Logical errors or data errors that must occur labels Jun 4, 2024
@DanielZhangQD DanielZhangQD added this to the 1.2.1 milestone Jun 4, 2024
@gouhongshen
Copy link
Contributor

同一个租户 mo_catalog 下的表,sys 租户和该租户本身用 mo_table_size, mo_table_rows 查出来的结果不同。

@aressu1985 aressu1985 modified the milestones: 1.2.1, 1.3.0 Jun 12, 2024
@sukki37 sukki37 modified the milestones: 2.0.0, 2.1.0 Oct 14, 2024
@aressu1985 aressu1985 modified the milestones: 2.1.0, 2.0.1 Nov 13, 2024
@aressu1985
Copy link
Contributor

经和徐鹏沟通,这个加一个开关,如果测试通过,就2.0.1打开,如果不通过,就还保持原来的处理

@gouhongshen
Copy link
Contributor

gouhongshen commented Nov 28, 2024

这个问题的原因是上层调用 MoTableRows, MoTableSize 的地方没有给出正确的 account id, 导致实际查询的是 dump 里面同名的 table。

现在的 account id 是从 context 里面取的,但里面是 dump 用户的。

@ouyuanning 看看分给谁看一下。

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/s1 High impact: Logical errors or data errors that must occur to-next-release
Projects
None yet
Development

No branches or pull requests

7 participants