pingcap / pingcap/tidb

The mem_buffer_bytes field in the cluster_tidb_trx table is not accurately measured

Open
#55,434 0 comments 0 reactions 0 assignees View on GitHub
severity/moderate sig/transaction type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)
CREATE TABLE test_update_large_txn (
id INT PRIMARY KEY AUTO_INCREMENT,
data TEXT
);
INSERT INTO test_update_large_txn (data)
SELECT REPEAT('a', 1024)
FROM
(SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL
SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL
SELECT 9 UNION ALL SELECT 10) a, -- 10 rows
(SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL
SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL
SELECT 9 UNION ALL SELECT 10) b, -- 100 rows
(SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL
SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL
SELECT 9 UNION ALL SELECT 10) c, -- 1000 rows
(SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL
SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL
SELECT 9 UNION ALL SELECT 10) d; -- 10000 rows

START TRANSACTION;

UPDATE test_update_large_txn
SET data = REPEAT('b', 1024)
WHERE id <= 10000;

COMMIT;

### 2. What did you expect to see? (Required)
I hope to see an accurate value for mem_buffer_bytes.

### 3. What did you see instead (Required)
--During this period, mem_buffer_bytes consistently showed 0
SELECT
INSTANCE,
id,
start_time,
mem_buffer_keys,
mem_buffer_bytes
FROM
information_schema.cluster_tidb_trx
WHERE
mem_buffer_bytes > =0;
### 4. What is your TiDB version? (Required)
v6.5.6

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.