Skip to content

Commit 84ebe8b

Browse files
Erik Frosethdahlerlend
authored andcommitted
WL#9223
Post-push fix: The test perfschema.threads_history gave a different result in release and debug builds. The root cause for this was that the default size for performance_schema_events_waits_history_long_size is 10000. The server creates a different number of events_waits markers in release and debug, and in debug it exceeds 10000 for the table events_waits_history_long. The result is that the performance schema table starts to eat up itself, since it is implemented as a ring buffer. This would give a different result in the test file for release and debug builds. The fix is to increase the size of the variable performance_schema_events_waits_history_long_size to ensure that the performance schema table doesn't start to eat up itself. Change-Id: I354bc1ae48630639c947d85a5fdf3e65c4d878ed
1 parent 41ff89b commit 84ebe8b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

mysql-test/suite/perfschema/r/threads_history.result

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# restart: --performance_schema_events_waits_history_long_size=20000
12
create user user1@localhost;
23
create user user2@localhost;
34
create user user3@localhost;
@@ -220,7 +221,7 @@ idle
220221
has_waits
221222
1
222223
has_waits
223-
0
224+
1
224225
"=========================== Waits user 2"
225226
EVENT_NAME
226227
idle
@@ -615,7 +616,7 @@ idle
615616
has_waits
616617
1
617618
has_waits
618-
0
619+
1
619620
"=========================== Waits user 2"
620621
EVENT_NAME
621622
idle

mysql-test/suite/perfschema/t/threads_history.test

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
# Test requires: sp-protocol/ps-protocol/view-protocol/cursor-protocol disabled
55
--source include/no_protocol.inc
66

7+
# Increase the size of performance_schema_events_waits_history_long_size so
8+
# that the table doesn't get truncated when running full.
9+
let $restart_parameters=restart: --performance_schema_events_waits_history_long_size=20000;
10+
--source include/restart_mysqld.inc
11+
712
create user user1@localhost;
813
create user user2@localhost;
914
create user user3@localhost;
@@ -237,7 +242,7 @@ eval select EVENT_NAME from performance_schema.events_waits_current
237242
order by THREAD_ID, EVENT_ID;
238243
eval select (count(*) > 5) as has_waits from performance_schema.events_waits_history
239244
where THREAD_ID = $con1_thread_id;
240-
eval select (count(*) > 16) as has_waits from performance_schema.events_waits_history_long
245+
eval select (count(*) > 15) as has_waits from performance_schema.events_waits_history_long
241246
where THREAD_ID = $con1_thread_id;
242247

243248
echo "=========================== Waits user 2";
@@ -667,7 +672,7 @@ eval select EVENT_NAME from performance_schema.events_waits_current
667672
order by THREAD_ID, EVENT_ID;
668673
eval select (count(*) > 5) as has_waits from performance_schema.events_waits_history
669674
where THREAD_ID = $con1_thread_id;
670-
eval select (count(*) > 16) as has_waits from performance_schema.events_waits_history_long
675+
eval select (count(*) > 15) as has_waits from performance_schema.events_waits_history_long
671676
where THREAD_ID = $con1_thread_id;
672677

673678
echo "=========================== Waits user 2";

0 commit comments

Comments
 (0)