File: rpl_eventlog_psi_memory.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (92 lines) | stat: -rw-r--r-- 4,076 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
###############################################################################
# ==== Purpose ====
# This test verifies following for 'Log_event' event name in replica:
#  - Verify that current_number_of_bytes_used entry in performance schema
#    memory_summary_by_thread_by_event_name table is matching before and after
#    the transactions
#  - Verify that current_number_of_bytes_used entry in performance schema
#    memory_summary_by_thread_by_event_name and
#    memory_summary_global_by_event_name are matching before and after the
#    transactions
#
# ==== Requirements ====
# 1) At thread level, after the transaction, performance schema instrumented
#    current_number_of_bytes_used count should be same as the before count.
# 2) Thread level performance schema instrumented current_number_of_bytes_used
#    count should match with corresponding global level count before and after
#    the transactions
#
# ==== Implementation ====
# 1. Initial setup
# 2. Verify that current_number_of_bytes_used for 'memory/sql/Log_event' is
#    same at global and thread level
# 3. Perform transactions and sync with replica
# 4. Verify that current_number_of_bytes_used for 'memory/sql/Log_event' is
#    same at global and thread level after transactions
# 5. Verify that current_number_of_bytes_used for 'memory/sql/Log_event' is
#    same at thread level before and after transactions
# 6. Cleanup
#
# ==== References ====
# BUG#35546877: Memory consumption isssue
###############################################################################


--source include/have_binlog_format_row.inc
--source include/only_mts_replica_parallel_workers.inc

--echo
--echo # 1. Initial setup
--source include/master-slave.inc


--echo
--echo # 2. Verify that current_number_of_bytes_used for 'memory/sql/Log_event'
--echo #    is same at global and thread level
--source include/rpl_connection_slave.inc

--let $thread_current_number_of_bytes_used_before = `SELECT SUM(CURRENT_NUMBER_OF_BYTES_USED) AS THREAD FROM performance_schema.memory_summary_by_thread_by_event_name WHERE EVENT_NAME = 'memory/sql/Log_event' GROUP BY EVENT_NAME`

--let $global_current_number_of_bytes_used_before = `SELECT CURRENT_NUMBER_OF_BYTES_USED FROM performance_schema.memory_summary_global_by_event_name WHERE EVENT_NAME='memory/sql/Log_event'`

--let $assert_cond= [ SELECT $thread_current_number_of_bytes_used_before = $global_current_number_of_bytes_used_before]
--let $assert_text= Before memory count matches
--source include/assert.inc

--echo
--echo # 3. Perform transactions and sync with replica
--source include/rpl_connection_master.inc

CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
INSERT INTO t1 VALUES (1);
UPDATE t1 SET c1 = 10;
DELETE FROM t1;

--source include/sync_slave_sql_with_master.inc

# Sleep an extra second for replica to settle
--sleep 1

--echo
--echo # 4. Verify that current_number_of_bytes_used for 'memory/sql/Log_event'
--echo #    is same at global and thread level after transactions
--let $thread_current_number_of_bytes_used_after = `SELECT SUM(CURRENT_NUMBER_OF_BYTES_USED) AS THREAD FROM performance_schema.memory_summary_by_thread_by_event_name WHERE EVENT_NAME = 'memory/sql/Log_event' group by EVENT_NAME`

--let $global_current_number_of_bytes_used_after = `SELECT CURRENT_NUMBER_OF_BYTES_USED FROM performance_schema.memory_summary_global_by_event_name WHERE EVENT_NAME='memory/sql/Log_event'`

--let $assert_cond= [ SELECT $thread_current_number_of_bytes_used_after = $global_current_number_of_bytes_used_after]
--let $assert_text= After memory count matches
--source include/assert.inc

--echo
--echo # 5. Verify that current_number_of_bytes_used for 'memory/sql/Log_event'
--echo #    is same at thread level before and after transactions
--let $assert_cond= [ SELECT $thread_current_number_of_bytes_used_before = $thread_current_number_of_bytes_used_after]
--let $assert_text= Thread Memory count matches
--source include/assert.inc

--echo
--echo # 6. Cleanup
--source include/rpl_connection_master.inc
DROP TABLE t1;
--source include/rpl_end.inc