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

query table CLUSTER_TIDB_TRX generate records in CLUSTER_TIDB_TRX #25029

Open
vivid392845427 opened this issue Jun 1, 2021 · 1 comment
Open
Labels
severity/minor sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.

Comments

@vivid392845427
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

select * from CLUSTER_TIDB_TRX\G
select * from TIDB_TRX\G

2. What did you expect to see? (Required)

both of tables query return empty

3. What did you see instead (Required)

mysql> select * from CLUSTER_TIDB_TRX\G
*************************** 1. row ***************************
INSTANCE: tidb-cluster-tidb-0.tidb-cluster-tidb-peer.tidb-cluster.svc:10080
ID: 425339144411545601
START_TIME: 2021-06-01 09:34:31.150000
CURRENT_SQL_DIGEST: NULL
STATE: Normal
WAITING_START_TIME: NULL
LEN: 0
SIZE: 0
SESSION_ID: 51
USER: root
DB: information_schema
ALL_SQL_DIGESTS: [80fe946d359213f3d04e942a4ad48f8488512751a2b5168a14f7d3eec0242dce]
1 row in set (0.01 sec)

mysql> select DIGEST_TEXT from statements_summary where DIGEST='80fe946d359213f3d04e942a4ad48f8488512751a2b5168a14f7d3eec0242dce';
+----------------------------------+
| DIGEST_TEXT |
+----------------------------------+
| select * from cluster_tidb_trx |
+----------------------------------+
1 row in set (0.01 sec)

mysql> select * from TIDB_TRX\G
Empty set (0.00 sec)

4. What is your TiDB version? (Required)

Release Version: v5.1.0-alpha-84-gccaefa2a3
Edition: Community
Git Commit Hash: ccaefa2
Git Branch: master
UTC Build Time: 2021-06-01 06:50:46
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@vivid392845427 vivid392845427 added the type/bug The issue is confirmed as a bug. label Jun 1, 2021
@vivid392845427
Copy link
Author

anther scene:

tx1 on db1
mysql> create table t(a int);
Query OK, 0 rows affected (0.14 sec)

mysql> START TRANSACTION;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@tidb_current_ts;
+--------------------+
| @@tidb_current_ts  |
+--------------------+
| 428396193555415041 |
+--------------------+
1 row in set (0.00 sec)

mysql> select instance, id, start_time, current_sql_digest,current_sql_digest_text, state, waiting_start_time, mem_buffer_keys, mem_buffer_bytes, session_id, user, db, all_sql_digests from information_schema.cluster_tidb_trx\G
*************************** 1. row ***************************
               instance: release-master-1012-1-tidb-0.release-master-1012-1-tidb-peer.user-zhaoyu.svc:10080
                     id: 428396193555415041
             start_time: 2021-10-14 08:56:28.160000
     current_sql_digest: NULL
current_sql_digest_text: NULL
                  state: Idle
     waiting_start_time: NULL
        mem_buffer_keys: 0
       mem_buffer_bytes: 0
             session_id: 17537
                   user: root
                     db: test
        all_sql_digests: ["9a4170a059f3113e196bdac9c156d6cecf3ccbef8eb238b878d04e61aa7d9741","58f3717da2d79c14773a1e3094aaddeff2b11747d3aef95741151af9acba9d44","c8378315a107002c29f8d98875451b0463b7e5238fb9af45489026571a07ff8f","c8378315a107002c29f8d98875451b0463b7e5238fb9af45489026571a07ff8f","c8378315a107002c29f8d98875451b0463b7e5238fb9af45489026571a07ff8f"]
1 row in set (0.02 sec)

another connection not in transaction:
mysql> select instance, id, start_time, current_sql_digest,current_sql_digest_text, state, waiting_start_time, mem_buffer_keys, mem_buffer_bytes, session_id, user, db, all_sql_digests from information_schema.cluster_tidb_trx\G
*************************** 1. row ***************************
               instance: release-master-1012-1-tidb-0.release-master-1012-1-tidb-peer.user-zhaoyu.svc:10080
                     id: 428396193555415041
             start_time: 2021-10-14 08:56:28.160000
     current_sql_digest: NULL
current_sql_digest_text: NULL
                  state: Idle
     waiting_start_time: NULL
        mem_buffer_keys: 0
       mem_buffer_bytes: 0
             session_id: 17537
                   user: root
                     db: test
        all_sql_digests: ["9a4170a059f3113e196bdac9c156d6cecf3ccbef8eb238b878d04e61aa7d9741","58f3717da2d79c14773a1e3094aaddeff2b11747d3aef95741151af9acba9d44","c8378315a107002c29f8d98875451b0463b7e5238fb9af45489026571a07ff8f","c8378315a107002c29f8d98875451b0463b7e5238fb9af45489026571a07ff8f","c8378315a107002c29f8d98875451b0463b7e5238fb9af45489026571a07ff8f"]
*************************** 2. row ***************************
               instance: release-master-1012-1-tidb-0.release-master-1012-1-tidb-peer.user-zhaoyu.svc:10080
                     id: 428396245381283841
             start_time: 2021-10-14 08:59:45.860000
     current_sql_digest: NULL
current_sql_digest_text: NULL
                  state: Idle
     waiting_start_time: NULL
        mem_buffer_keys: 0
       mem_buffer_bytes: 0
             session_id: 17543
                   user: root
                     db: test
        all_sql_digests: ["c8378315a107002c29f8d98875451b0463b7e5238fb9af45489026571a07ff8f"]
2 rows in set (0.01 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants