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]: Cannot query statement_info record after CN restart #10090

Closed
1 task done
DanielZhangQD opened this issue Jun 16, 2023 · 60 comments
Closed
1 task done

[Bug]: Cannot query statement_info record after CN restart #10090

DanielZhangQD opened this issue Jun 16, 2023 · 60 comments
Assignees
Labels
duplicate This issue or pull request already exists kind/bug Something isn't working severity/s0 Extreme impact: Cause the application to break down and seriously affect the use to-next-release
Milestone

Comments

@DanielZhangQD
Copy link
Contributor

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93): nightly-9207b269
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

  • Delete the cache dir in the CN Pod
  • Delete the CN Pod
  • Run query after CN is started
  • Query the statement_info record but get empty record
企业微信截图_adf318b2-11d1-4200-bc1b-ed6249a895ca an

Expected Behavior

Get the statement_info record successfully

Steps to Reproduce

See detail in `Actual Behavior`

Additional information

No response

@DanielZhangQD DanielZhangQD added kind/bug Something isn't working needs-triage severity/s0 Extreme impact: Cause the application to break down and seriously affect the use labels Jun 16, 2023
@gavinyue
Copy link
Contributor

测试aggr的时候, 一并测试这个问题。

@gavinyue
Copy link
Contributor

Still pending

@gavinyue
Copy link
Contributor

Pending for the stmt_aggr pr merge. Stuck on dn oom

@gavinyue
Copy link
Contributor

Looking into this issue.

@gavinyue
Copy link
Contributor

Tried this on eks.
Delete the pod

Screenshot 2023-06-29 at 6 02 33 PM

Then run the query against the new pod. Can find the query in the statementinfo table

Screenshot 2023-06-29 at 6 02 24 PM

@gavinyue
Copy link
Contributor

@DanielZhangQD Could you re-check after #10302 merge?

Thanks.

@DanielZhangQD
Copy link
Contributor Author

OK

@DanielZhangQD
Copy link
Contributor Author

@DanielZhangQD Could you re-check after #10302 merge?

Thanks.

@gavinyue It does not work:

MySQL [(none)]> pager cat > /dev/null;SELECT `statement_id`,`stats`,`duration`,`sql_source_type`,`account`,`response_at` FROM `system`.`statement_info` where status != 'Running' and account != 'sys' and account != 'mocloud_mo_ob' and response_at >= '2023-06-12 06:30:00' and response_at < '2023-06-12 06:35:00';pager;select last_query_id(-1);
PAGER set to 'cat > /dev/null'

Empty set (12.47 sec)

Default pager wasn't set, using stdout.
+--------------------------------------+
| last_query_id(-1)                    |
+--------------------------------------+
| 9a943a5a-1979-11ee-abfe-56c9384c6f1f |
+--------------------------------------+
1 row in set (0.01 sec)

MySQL [(none)]> select statement,stats,duration from system.statement_info where statement_id = '9a943a5a-1979-11ee-abfe-56c9384c6f1f';

Empty set (8.20 sec)

MySQL [(none)]>
MySQL [(none)]> select statement,stats,duration from system.statement_info where statement_id = '9a943a5a-1979-11ee-abfe-56c9384c6f1f';
Empty set (1.03 sec)

MySQL [(none)]> select statement,stats,duration from system.statement_info where statement_id = '9a943a5a-1979-11ee-abfe-56c9384c6f1f';
Empty set (0.68 sec)

MySQL [(none)]> pager cat > /dev/null;SELECT `statement_id`,`stats`,`duration`,`sql_source_type`,`account`,`response_at` FROM `system`.`statement_info` where status != 'Running' and account != 'sys' and account != 'mocloud_mo_ob' and response_at >= '2023-06-20 01:30:00' and response_at < '2023-06-20 02:30:00';pager;select last_query_id(-1);
PAGER set to 'cat > /dev/null'

6101126 rows in set (54.05 sec)

Default pager wasn't set, using stdout.
+--------------------------------------+
| last_query_id(-1)                    |
+--------------------------------------+
| 1996622d-197a-11ee-abfe-56c9384c6f1f |
+--------------------------------------+
1 row in set (0.00 sec)

MySQL [(none)]> select statement,stats,duration from system.statement_info where statement_id = '1996622d-197a-11ee-abfe-56c9384c6f1f';
Empty set (1.54 sec)

@DanielZhangQD DanielZhangQD removed their assignment Jul 3, 2023
@gavinyue
Copy link
Contributor

gavinyue commented Jul 6, 2023

Follow this today.

@gavinyue
Copy link
Contributor

Pending

@gavinyue
Copy link
Contributor

@DanielZhangQD It has a 15+second latentcy for the statement being inserted in the statementinfo table. Did you wait for 15 seconds before running the select query?

@gavinyue
Copy link
Contributor

Discussed with the Daniel.

Need to confirm with him again whether this is still an issue.

@gavinyue
Copy link
Contributor

Will follow with Daniel to see whether to close this issue or not.

@gavinyue
Copy link
Contributor

Pending

1 similar comment
@gavinyue
Copy link
Contributor

Pending

@gavinyue
Copy link
Contributor

gavinyue commented Aug 3, 2023

Need to discuss with author whether this is still an issue.

@gavinyue
Copy link
Contributor

gavinyue commented Aug 8, 2023

Pending

1 similar comment
@gavinyue
Copy link
Contributor

Pending

@gavinyue
Copy link
Contributor

需要和author 沟通

@gavinyue
Copy link
Contributor

又测了一下,暂时还是无法复现这个问题

@gavinyue
Copy link
Contributor

暂时还没找到合适的办法

@gavinyue
Copy link
Contributor

Pending

@gavinyue
Copy link
Contributor

pending

@gavinyue
Copy link
Contributor

Pending

1 similar comment
@gavinyue
Copy link
Contributor

gavinyue commented Dec 5, 2023

Pending

@gavinyue
Copy link
Contributor

gavinyue commented Dec 8, 2023

暂时没有解决

@gavinyue
Copy link
Contributor

Pending

@gavinyue
Copy link
Contributor

Pending.

@gavinyue
Copy link
Contributor

Pending

5 similar comments
@gavinyue
Copy link
Contributor

Pending

@gavinyue
Copy link
Contributor

gavinyue commented Jan 4, 2024

Pending

@gavinyue
Copy link
Contributor

Pending

@gavinyue
Copy link
Contributor

Pending

@gavinyue
Copy link
Contributor

Pending

@fengttt fengttt assigned xzxiong and gavinyue and unassigned gavinyue Jan 23, 2024
@gavinyue gavinyue removed their assignment Jan 23, 2024
@xzxiong
Copy link
Contributor

xzxiong commented Jan 24, 2024

明天统一梳理一下

@xzxiong
Copy link
Contributor

xzxiong commented Jan 25, 2024

从目前方案来说,本身无法保证时延。但目前对于这个模块的可观测性来说,太差了。dup #14298
Next: 优化整体的可观测性

  1. sql 写入的延迟;
  2. csv写入延迟;
  3. csv回写mo的延迟
  4. 哪些文件回写过mo
  5. ...

@xzxiong xzxiong added duplicate This issue or pull request already exists to-next-release labels Jan 25, 2024
@xzxiong
Copy link
Contributor

xzxiong commented Jan 30, 2024

pending

5 similar comments
@xzxiong
Copy link
Contributor

xzxiong commented Feb 2, 2024

pending

@xzxiong
Copy link
Contributor

xzxiong commented Feb 8, 2024

pending

@xzxiong
Copy link
Contributor

xzxiong commented Feb 21, 2024

pending

@xzxiong
Copy link
Contributor

xzxiong commented Feb 26, 2024

pending

@xzxiong
Copy link
Contributor

xzxiong commented Feb 29, 2024

pending

@xzxiong
Copy link
Contributor

xzxiong commented Mar 1, 2024

@DanielZhangQD Could you re-check after #10302 merge?
Thanks.

@gavinyue It does not work:

MySQL [(none)]> pager cat > /dev/null;SELECT `statement_id`,`stats`,`duration`,`sql_source_type`,`account`,`response_at` FROM `system`.`statement_info` where status != 'Running' and account != 'sys' and account != 'mocloud_mo_ob' and response_at >= '2023-06-12 06:30:00' and response_at < '2023-06-12 06:35:00';pager;select last_query_id(-1);
PAGER set to 'cat > /dev/null'

Empty set (12.47 sec)

Default pager wasn't set, using stdout.
+--------------------------------------+
| last_query_id(-1)                    |
+--------------------------------------+
| 9a943a5a-1979-11ee-abfe-56c9384c6f1f |
+--------------------------------------+
1 row in set (0.01 sec)

MySQL [(none)]> select statement,stats,duration from system.statement_info where statement_id = '9a943a5a-1979-11ee-abfe-56c9384c6f1f';

Empty set (8.20 sec)

MySQL [(none)]>
MySQL [(none)]> select statement,stats,duration from system.statement_info where statement_id = '9a943a5a-1979-11ee-abfe-56c9384c6f1f';
Empty set (1.03 sec)

MySQL [(none)]> select statement,stats,duration from system.statement_info where statement_id = '9a943a5a-1979-11ee-abfe-56c9384c6f1f';
Empty set (0.68 sec)

MySQL [(none)]> pager cat > /dev/null;SELECT `statement_id`,`stats`,`duration`,`sql_source_type`,`account`,`response_at` FROM `system`.`statement_info` where status != 'Running' and account != 'sys' and account != 'mocloud_mo_ob' and response_at >= '2023-06-20 01:30:00' and response_at < '2023-06-20 02:30:00';pager;select last_query_id(-1);
PAGER set to 'cat > /dev/null'

6101126 rows in set (54.05 sec)

Default pager wasn't set, using stdout.
+--------------------------------------+
| last_query_id(-1)                    |
+--------------------------------------+
| 1996622d-197a-11ee-abfe-56c9384c6f1f |
+--------------------------------------+
1 row in set (0.00 sec)

MySQL [(none)]> select statement,stats,duration from system.statement_info where statement_id = '1996622d-197a-11ee-abfe-56c9384c6f1f';
Empty set (1.54 sec)

@DanielZhangQD 现在看是 OK的,目前新版本上未复现。
env: aliyun / new-dev
version: 1.1-dev

image

mysql> pager cat > /tmp/pager_20240301.txt;
PAGER set to 'cat > /tmp/pager_20240301.txt'
mysql> select * from system.statement_info where request_at > '2024-03-01 07:40:14.410045' and request_at < '2024-03-01 07:46:18.706256' and statement_id = '018df8f6-fcb6-72ea-b5d1-6ec8d1addacc'; pager; select last_query_id(-1); select sleep(15); select now();
1 row in set (0.16 sec)

Default pager wasn't set, using stdout.
+--------------------------------------+
| last_query_id(-1)                    |
+--------------------------------------+
| 018df8fc-2f17-72a0-a06d-ea51eba87e2e |
+--------------------------------------+
1 row in set (0.03 sec)

+-----------+
| sleep(15) |
+-----------+
|         0 |
+-----------+
1 row in set (15.03 sec)

+----------------------------+
| now()                      |
+----------------------------+
| 2024-03-01 07:48:28.444927 |
+----------------------------+
1 row in set (0.04 sec)

mysql> select statement_id, request_at, response_at, status, duration / 1e6 ms, stats from system.statement_info where request_at > '2024-03-01 07:48:00.444927' and reque
+--------------------------------------+----------------------------+----------------------------+---------+------------+--------------------------------------+
| statement_id                         | request_at                 | response_at                | status  | ms         | stats                                |
+--------------------------------------+----------------------------+----------------------------+---------+------------+--------------------------------------+
| 018df8fc-2f17-72a0-a06d-ea51eba87e2e | 2024-03-01 07:48:10.000000 | 2024-03-01 07:48:15.000000 | Success | 129.438229 | [3,15133034,11366772.319,0,1,6505,2] |
+--------------------------------------+----------------------------+----------------------------+---------+------------+--------------------------------------+
1 row in set (0.04 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists kind/bug Something isn't working severity/s0 Extreme impact: Cause the application to break down and seriously affect the use to-next-release
Projects
None yet
Development

No branches or pull requests

5 participants