Commit a405218
committed
MDEV-37890 - sys_vars.thread_cache_size_func fails sporadically
Removed redundant FLUSH STATUS, doesn't serve any purpose in this test.
Shrinking thread_cache_size is done without appropriate mutex protection
and it doesn't flush thread cache. It means we may have more threads in
the cache than thread_cache_size allows.
First FLUSH THREADS (line 36) was added just in case
thread_cache_size_func-master.opt file is removed and raising
thread_cache_size from 0 to 3 becomes shrinking from the default value
to 3.
Second FLUSH THREADS (line 81) was added to fix timeout in wait
condition (line 100). It serves as a barrier that guarantees fourth
preceding disconnect won't pick one of subsequent connects and in turn
leave 2 threads in the cache.
Threads_cached cannot be queried for exact value because there can
(or cannot) be disconnecting threads from previous tests or mtr utility
connection. There is also a gap between server_threads.erase() (aka
removal from I_S.PROCESSLIST) and thread_cache.park() (aka
Threads_cached++). All in all it makes Threads_cached value
unpredictable after thread_cache_size is set to 3.
Instead of querying for exact value, just make sure Threads_cached
doesn't exceed thread_cache_size.1 parent 8be6d25 commit a405218
File tree
2 files changed
+12
-15
lines changed- mysql-test/suite/sys_vars
- r
- t
2 files changed
+12
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
39 | | - | |
| 36 | + | |
| 37 | + | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
56 | | - | |
57 | | - | |
| 54 | + | |
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
| |||
81 | 78 | | |
82 | 79 | | |
83 | 80 | | |
| 81 | + | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
| |||
0 commit comments