Merge lp:~akopytov/percona-server/tp-high-prio-tickets-by-default-5.5 into lp:percona-server/5.5

Proposed by Alexey Kopytov
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 600
Proposed branch: lp:~akopytov/percona-server/tp-high-prio-tickets-by-default-5.5
Merge into: lp:percona-server/5.5
Diff against target: 157 lines (+24/-24)
7 files modified
Percona-Server/mysql-test/suite/sys_vars/r/thread_pool_high_prio_tickets_basic.result (+12/-7)
Percona-Server/mysql-test/suite/sys_vars/t/thread_pool_high_prio_tickets_basic.test (+6/-5)
Percona-Server/sql/sql_class.h (+2/-0)
Percona-Server/sql/sys_vars.cc (+2/-2)
Percona-Server/sql/threadpool.h (+0/-5)
Percona-Server/sql/threadpool_common.cc (+0/-3)
Percona-Server/sql/threadpool_unix.cc (+2/-2)
To merge this branch: bzr merge lp:~akopytov/percona-server/tp-high-prio-tickets-by-default-5.5
Reviewer Review Type Date Requested Status
George Ormond Lorch III (community) g2 Approve
Review via email: mp+197392@code.launchpad.net

Description of the change

    Implementation of
    https://blueprints.launchpad.net/percona-server/+spec/tp-high-prio-tickets-by-default
    and fix for bug #1166271 “Make thead_pool_high_prio_tickets a session
    variable”.

    Changed the default value of thread_pool_high_prio_tickets to UINT_MAX
    (4294967295) and made it a session variable.

http://jenkins.percona.com/view/PS%205.5/job/percona-server-5.5-param/899/

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) :
review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/mysql-test/suite/sys_vars/r/thread_pool_high_prio_tickets_basic.result'
2--- Percona-Server/mysql-test/suite/sys_vars/r/thread_pool_high_prio_tickets_basic.result 2013-04-03 10:26:31 +0000
3+++ Percona-Server/mysql-test/suite/sys_vars/r/thread_pool_high_prio_tickets_basic.result 2013-12-02 14:44:41 +0000
4@@ -1,21 +1,24 @@
5 SET @start_global_value = @@global.thread_pool_high_prio_tickets;
6+set @@global.thread_pool_high_prio_tickets=default;
7 select @@global.thread_pool_high_prio_tickets;
8 @@global.thread_pool_high_prio_tickets
9-0
10+4294967295
11+set @@session.thread_pool_high_prio_tickets=default;
12 select @@session.thread_pool_high_prio_tickets;
13-ERROR HY000: Variable 'thread_pool_high_prio_tickets' is a GLOBAL variable
14+@@session.thread_pool_high_prio_tickets
15+4294967295
16 show global variables like 'thread_pool_high_prio_tickets';
17 Variable_name Value
18-thread_pool_high_prio_tickets 0
19+thread_pool_high_prio_tickets 4294967295
20 show session variables like 'thread_pool_high_prio_tickets';
21 Variable_name Value
22-thread_pool_high_prio_tickets 0
23+thread_pool_high_prio_tickets 4294967295
24 select * from information_schema.global_variables where variable_name='thread_pool_high_prio_tickets';
25 VARIABLE_NAME VARIABLE_VALUE
26-THREAD_POOL_HIGH_PRIO_TICKETS 0
27+THREAD_POOL_HIGH_PRIO_TICKETS 4294967295
28 select * from information_schema.session_variables where variable_name='thread_pool_high_prio_tickets';
29 VARIABLE_NAME VARIABLE_VALUE
30-THREAD_POOL_HIGH_PRIO_TICKETS 0
31+THREAD_POOL_HIGH_PRIO_TICKETS 4294967295
32 set global thread_pool_high_prio_tickets=60;
33 select @@global.thread_pool_high_prio_tickets;
34 @@global.thread_pool_high_prio_tickets
35@@ -25,7 +28,9 @@
36 @@global.thread_pool_high_prio_tickets
37 4294967295
38 set session thread_pool_high_prio_tickets=1;
39-ERROR HY000: Variable 'thread_pool_high_prio_tickets' is a GLOBAL variable and should be set with SET GLOBAL
40+select @@session.thread_pool_high_prio_tickets;
41+@@session.thread_pool_high_prio_tickets
42+1
43 set global thread_pool_high_prio_tickets=1.1;
44 ERROR 42000: Incorrect argument type to variable 'thread_pool_high_prio_tickets'
45 set global thread_pool_high_prio_tickets=1e1;
46
47=== modified file 'Percona-Server/mysql-test/suite/sys_vars/t/thread_pool_high_prio_tickets_basic.test'
48--- Percona-Server/mysql-test/suite/sys_vars/t/thread_pool_high_prio_tickets_basic.test 2013-04-03 10:26:31 +0000
49+++ Percona-Server/mysql-test/suite/sys_vars/t/thread_pool_high_prio_tickets_basic.test 2013-12-02 14:44:41 +0000
50@@ -3,12 +3,13 @@
51 --source include/not_embedded.inc
52 SET @start_global_value = @@global.thread_pool_high_prio_tickets;
53
54-#
55-# exists as global only
56-#
57+# Test the default value
58+set @@global.thread_pool_high_prio_tickets=default;
59 select @@global.thread_pool_high_prio_tickets;
60---error ER_INCORRECT_GLOBAL_LOCAL_VAR
61+
62+set @@session.thread_pool_high_prio_tickets=default;
63 select @@session.thread_pool_high_prio_tickets;
64+
65 show global variables like 'thread_pool_high_prio_tickets';
66 show session variables like 'thread_pool_high_prio_tickets';
67 select * from information_schema.global_variables where variable_name='thread_pool_high_prio_tickets';
68@@ -21,8 +22,8 @@
69 select @@global.thread_pool_high_prio_tickets;
70 set global thread_pool_high_prio_tickets=4294967295;
71 select @@global.thread_pool_high_prio_tickets;
72---error ER_GLOBAL_VARIABLE
73 set session thread_pool_high_prio_tickets=1;
74+select @@session.thread_pool_high_prio_tickets;
75
76 #
77 # incorrect types
78
79=== modified file 'Percona-Server/sql/sql_class.h'
80--- Percona-Server/sql/sql_class.h 2013-10-22 13:33:14 +0000
81+++ Percona-Server/sql/sql_class.h 2013-12-02 14:44:41 +0000
82@@ -561,6 +561,8 @@
83
84 my_bool expand_fast_index_creation;
85 my_bool pseudo_slave_mode;
86+
87+ uint threadpool_high_prio_tickets;
88 } SV;
89
90
91
92=== modified file 'Percona-Server/sql/sys_vars.cc'
93--- Percona-Server/sql/sys_vars.cc 2013-10-22 13:33:14 +0000
94+++ Percona-Server/sql/sys_vars.cc 2013-12-02 14:44:41 +0000
95@@ -2385,8 +2385,8 @@
96 "thread_pool_high_prio_tickets",
97 "Number of tickets to enter the high priority event queue for each "
98 "transaction.",
99- GLOBAL_VAR(threadpool_high_prio_tickets), CMD_LINE(REQUIRED_ARG),
100- VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)
101+ SESSION_VAR(threadpool_high_prio_tickets), CMD_LINE(REQUIRED_ARG),
102+ VALID_RANGE(0, UINT_MAX), DEFAULT(UINT_MAX), BLOCK_SIZE(1)
103 );
104 #endif /* !WIN32 */
105 static Sys_var_uint Sys_threadpool_max_threads(
106
107=== modified file 'Percona-Server/sql/threadpool.h'
108--- Percona-Server/sql/threadpool.h 2013-04-03 10:26:31 +0000
109+++ Percona-Server/sql/threadpool.h 2013-12-02 14:44:41 +0000
110@@ -22,11 +22,6 @@
111 extern uint threadpool_stall_limit; /* time interval in 10 ms units for stall checks*/
112 extern uint threadpool_max_threads; /* Maximum threads in pool */
113 extern uint threadpool_oversubscribe; /* Maximum active threads in group */
114-#ifndef _WIN32
115-extern uint threadpool_high_prio_tickets; /* High prio queue tickets */
116-#endif
117-
118-
119
120 /* Common thread pool routines, suitable for different implementations */
121 extern void threadpool_remove_connection(THD *thd);
122
123=== modified file 'Percona-Server/sql/threadpool_common.cc'
124--- Percona-Server/sql/threadpool_common.cc 2013-08-08 16:43:40 +0000
125+++ Percona-Server/sql/threadpool_common.cc 2013-12-02 14:44:41 +0000
126@@ -33,9 +33,6 @@
127 uint threadpool_stall_limit;
128 uint threadpool_max_threads;
129 uint threadpool_oversubscribe;
130-#ifndef _WIN32
131-uint threadpool_high_prio_tickets;
132-#endif
133
134 /* Stats */
135 TP_STATISTICS tp_stats;
136
137=== modified file 'Percona-Server/sql/threadpool_unix.cc'
138--- Percona-Server/sql/threadpool_unix.cc 2013-08-08 16:43:40 +0000
139+++ Percona-Server/sql/threadpool_unix.cc 2013-12-02 14:44:41 +0000
140@@ -719,7 +719,7 @@
141 }
142 else
143 {
144- c->tickets= threadpool_high_prio_tickets;
145+ c->tickets= c->thd->variables.threadpool_high_prio_tickets;
146 thread_group->queue.push_back(c);
147 }
148 }
149@@ -1016,7 +1016,7 @@
150 DBUG_ENTER("queue_put");
151
152 mysql_mutex_lock(&thread_group->mutex);
153- connection->tickets= threadpool_high_prio_tickets;
154+ connection->tickets= connection->thd->variables.threadpool_high_prio_tickets;
155 thread_group->queue.push_back(connection);
156
157 if (thread_group->active_thread_count == 0)

Subscribers

People subscribed via source and target branches