Merge lp:~longbow/percona-server/ps55_kill_idle_trx into lp:percona-server/5.5

Proposed by Valentine Gostev
Status: Rejected
Rejected by: Stewart Smith
Proposed branch: lp:~longbow/percona-server/ps55_kill_idle_trx
Merge into: lp:percona-server/5.5
Diff against target: 386 lines (+197/-40)
5 files modified
mysql-test/percona_server_variables_debug.result (+1/-0)
mysql-test/percona_server_variables_release.result (+1/-0)
patches/innodb_kill_idle_transaction.patch (+191/-39)
patches/mysql-test.diff (+3/-1)
patches/series (+1/-0)
To merge this branch: bzr merge lp:~longbow/percona-server/ps55_kill_idle_trx
Reviewer Review Type Date Requested Status
Stewart Smith (community) Needs Resubmitting
Oleg Tsarev (community) Approve
Review via email: mp+72361@code.launchpad.net

Description of the change

Tests for innodb_kill_idle_transaction.patch

http://jenkins.percona.com/view/Percona%20Server%205.5/job/percona-server-5.5-param/93/

PS sporadic fails on centos5 and debian6 discovered.

To post a comment you must log in.
Revision history for this message
Oleg Tsarev (tsarev) wrote :

Looks fine for me, except sleep(3) - but in current situation (timeout) this is reasonable.

review: Approve
Revision history for this message
Stewart Smith (stewart) wrote :

So, to me it looks like the test failures show an actual bug that should be fixed before we enable this. So, I'm marking as resubmit, for when we have this bug fixed.

i.e. please file a bug and point Yasufumi at it.

review: Needs Resubmitting
Revision history for this message
Stewart Smith (stewart) wrote :

merged in other merge reqs

Unmerged revisions

153. By longbow <longbow@mil-nb>

Added tests for innodb_kill_idle_transaction.patch and added patch to series

152. By Stewart Smith

merge 5.5.15 rebase

151. By Stewart Smith

use S3 download site

150. By Stewart Smith

merge a few quilt related fixes to misc scripts we use

149. By Stewart Smith

merge atomic_cas_64 fix

148. By Stewart Smith

merge compiler warning fix for innodb comparison of unsigned expression always true

147. By Stewart Smith

merge fix of innodb_bug60049 test failure. The master thread should purge if purge_thread seems already exited in shutdown state.

146. By Stewart Smith

update percona_server_variables_debug.result for disabled INNODB_FAKE_CHANGES and KILL_IDLE_TRANSACTION

145. By Stewart Smith

fix all_vars test for removal of INNODB FAKE_CHANGES and KILL_IDLE_TRANSACTION

144. By Stewart Smith

move valgrind_zlib_suppression patch into patches/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mysql-test/percona_server_variables_debug.result'
2--- mysql-test/percona_server_variables_debug.result 2011-08-04 23:23:45 +0000
3+++ mysql-test/percona_server_variables_debug.result 2011-08-21 21:29:24 +0000
4@@ -115,6 +115,7 @@
5 INNODB_IBUF_MAX_SIZE
6 INNODB_IMPORT_TABLE_FROM_XTRABACKUP
7 INNODB_IO_CAPACITY
8+INNODB_KILL_IDLE_TRANSACTION
9 INNODB_LARGE_PREFIX
10 INNODB_LAZY_DROP_TABLE
11 INNODB_LOCKS_UNSAFE_FOR_BINLOG
12
13=== modified file 'mysql-test/percona_server_variables_release.result'
14--- mysql-test/percona_server_variables_release.result 2011-08-04 19:16:18 +0000
15+++ mysql-test/percona_server_variables_release.result 2011-08-21 21:29:24 +0000
16@@ -112,6 +112,7 @@
17 INNODB_IBUF_MAX_SIZE
18 INNODB_IMPORT_TABLE_FROM_XTRABACKUP
19 INNODB_IO_CAPACITY
20+INNODB_KILL_IDLE_TRANSACTION
21 INNODB_LARGE_PREFIX
22 INNODB_LAZY_DROP_TABLE
23 INNODB_LOCKS_UNSAFE_FOR_BINLOG
24
25=== renamed file 'innodb_kill_idle_transaction.patch' => 'patches/innodb_kill_idle_transaction.patch'
26--- innodb_kill_idle_transaction.patch 2011-07-12 15:59:46 +0000
27+++ patches/innodb_kill_idle_transaction.patch 2011-08-21 21:29:24 +0000
28@@ -5,10 +5,9 @@
29 #!!! notice !!!
30 # Any small change to this file in the main branch
31 # should be done or reviewed by the maintainer!
32-diff -ruN a/include/mysql/plugin.h b/include/mysql/plugin.h
33---- a/include/mysql/plugin.h 2011-06-22 01:42:39.000000000 +0900
34-+++ b/include/mysql/plugin.h 2011-07-12 22:19:58.000000000 +0900
35-@@ -625,6 +625,12 @@
36+--- a/include/mysql/plugin.h
37++++ b/include/mysql/plugin.h
38+@@ -639,6 +639,12 @@
39 */
40 void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton,
41 const void *ha_data);
42@@ -21,10 +20,9 @@
43 #ifdef __cplusplus
44 }
45 #endif
46-diff -ruN a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
47---- a/include/mysql/plugin_audit.h.pp 2011-06-22 01:42:39.000000000 +0900
48-+++ b/include/mysql/plugin_audit.h.pp 2011-07-13 00:53:06.000000000 +0900
49-@@ -195,6 +195,9 @@
50+--- a/include/mysql/plugin_audit.h.pp
51++++ b/include/mysql/plugin_audit.h.pp
52+@@ -205,6 +205,9 @@
53 void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
54 void thd_set_ha_data(void* thd, const struct handlerton *hton,
55 const void *ha_data);
56@@ -34,10 +32,9 @@
57 struct mysql_event_general
58 {
59 unsigned int event_subclass;
60-diff -ruN a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp
61---- a/include/mysql/plugin_auth.h.pp 2011-06-22 01:42:39.000000000 +0900
62-+++ b/include/mysql/plugin_auth.h.pp 2011-07-13 00:53:06.000000000 +0900
63-@@ -195,6 +195,9 @@
64+--- a/include/mysql/plugin_auth.h.pp
65++++ b/include/mysql/plugin_auth.h.pp
66+@@ -205,6 +205,9 @@
67 void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
68 void thd_set_ha_data(void* thd, const struct handlerton *hton,
69 const void *ha_data);
70@@ -47,10 +44,9 @@
71 #include <mysql/plugin_auth_common.h>
72 typedef struct st_plugin_vio_info
73 {
74-diff -ruN a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp
75---- a/include/mysql/plugin_ftparser.h.pp 2011-06-22 01:42:39.000000000 +0900
76-+++ b/include/mysql/plugin_ftparser.h.pp 2011-07-13 00:53:06.000000000 +0900
77-@@ -148,6 +148,9 @@
78+--- a/include/mysql/plugin_ftparser.h.pp
79++++ b/include/mysql/plugin_ftparser.h.pp
80+@@ -158,6 +158,9 @@
81 void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
82 void thd_set_ha_data(void* thd, const struct handlerton *hton,
83 const void *ha_data);
84@@ -60,10 +56,9 @@
85 enum enum_ftparser_mode
86 {
87 MYSQL_FTPARSER_SIMPLE_MODE= 0,
88-diff -ruN a/sql/sql_class.cc b/sql/sql_class.cc
89---- a/sql/sql_class.cc 2011-06-22 01:42:40.000000000 +0900
90-+++ b/sql/sql_class.cc 2011-07-12 22:23:35.000000000 +0900
91-@@ -711,6 +711,26 @@
92+--- a/sql/sql_class.cc
93++++ b/sql/sql_class.cc
94+@@ -744,6 +744,26 @@
95 return buffer;
96 }
97
98@@ -90,10 +85,9 @@
99
100 /**
101 Implementation of Drop_table_error_handler::handle_condition().
102-diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
103---- a/storage/innobase/handler/ha_innodb.cc 2011-07-12 17:10:37.000000000 +0900
104-+++ b/storage/innobase/handler/ha_innodb.cc 2011-07-12 22:33:06.000000000 +0900
105-@@ -2828,6 +2828,10 @@
106+--- a/storage/innobase/handler/ha_innodb.cc
107++++ b/storage/innobase/handler/ha_innodb.cc
108+@@ -2827,6 +2827,10 @@
109
110 innobase_commit_concurrency_init_default();
111
112@@ -104,7 +98,7 @@
113 #ifdef HAVE_PSI_INTERFACE
114 /* Register keys with MySQL performance schema */
115 if (PSI_server) {
116-@@ -11586,6 +11590,48 @@
117+@@ -11585,6 +11589,48 @@
118 return(false);
119 }
120
121@@ -153,7 +147,7 @@
122 static SHOW_VAR innodb_status_variables_export[]= {
123 {"Innodb", (char*) &show_innodb_vars, SHOW_FUNC},
124 {NullS, NullS, SHOW_LONG}
125-@@ -11872,6 +11918,15 @@
126+@@ -11871,6 +11917,15 @@
127 "Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket",
128 NULL, NULL, 500L, 1L, ~0L, 0);
129
130@@ -169,7 +163,7 @@
131 static MYSQL_SYSVAR_LONG(file_io_threads, innobase_file_io_threads,
132 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR,
133 "Number of file I/O threads in InnoDB.",
134-@@ -12162,6 +12217,7 @@
135+@@ -12161,6 +12216,7 @@
136 MYSQL_SYSVAR(fast_checksum),
137 MYSQL_SYSVAR(commit_concurrency),
138 MYSQL_SYSVAR(concurrency_tickets),
139@@ -177,9 +171,8 @@
140 MYSQL_SYSVAR(data_file_path),
141 MYSQL_SYSVAR(doublewrite_file),
142 MYSQL_SYSVAR(data_home_dir),
143-diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
144---- a/storage/innobase/include/srv0srv.h 2011-07-12 17:10:37.000000000 +0900
145-+++ b/storage/innobase/include/srv0srv.h 2011-07-12 22:33:57.000000000 +0900
146+--- a/storage/innobase/include/srv0srv.h
147++++ b/storage/innobase/include/srv0srv.h
148 @@ -291,6 +291,7 @@
149 extern ulint srv_activity_count;
150 extern ulint srv_fatal_semaphore_wait_threshold;
151@@ -188,9 +181,8 @@
152
153 extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs,
154 query threads, and lock table: we allocate
155-diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
156---- a/storage/innobase/include/trx0trx.h 2011-07-12 16:47:24.000000000 +0900
157-+++ b/storage/innobase/include/trx0trx.h 2011-07-12 22:35:39.000000000 +0900
158+--- a/storage/innobase/include/trx0trx.h
159++++ b/storage/innobase/include/trx0trx.h
160 @@ -594,6 +594,8 @@
161 replication has processed */
162 const char* mysql_relay_log_file_name;
163@@ -200,9 +192,8 @@
164 /*------------------------------*/
165 ulint n_mysql_tables_in_use; /* number of Innobase tables
166 used in the processing of the current
167-diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
168---- a/storage/innobase/srv/srv0srv.c 2011-07-12 17:10:37.000000000 +0900
169-+++ b/storage/innobase/srv/srv0srv.c 2011-07-12 22:43:22.000000000 +0900
170+--- a/storage/innobase/srv/srv0srv.c
171++++ b/storage/innobase/srv/srv0srv.c
172 @@ -87,6 +87,11 @@
173 #include "mysql/plugin.h"
174 #include "mysql/service_thd_wait.h"
175@@ -262,9 +253,8 @@
176 /* Flush stderr so that a database user gets the output
177 to possible MySQL error file */
178
179-diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
180---- a/storage/innobase/trx/trx0trx.c 2011-07-12 17:05:25.000000000 +0900
181-+++ b/storage/innobase/trx/trx0trx.c 2011-07-12 22:44:08.000000000 +0900
182+--- a/storage/innobase/trx/trx0trx.c
183++++ b/storage/innobase/trx/trx0trx.c
184 @@ -143,6 +143,9 @@
185 trx->mysql_relay_log_file_name = "";
186 trx->mysql_relay_log_pos = 0;
187@@ -275,3 +265,165 @@
188 mutex_create(trx_undo_mutex_key, &trx->undo_mutex, SYNC_TRX_UNDO);
189
190 trx->rseg = NULL;
191+--- /dev/null
192++++ b/mysql-test/include/percona_innodb_kill_idle_trx_show.inc
193+@@ -0,0 +1,2 @@
194++SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
195++SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
196+--- /dev/null
197++++ b/mysql-test/t/percona_innodb_kill_idle_trx.test
198+@@ -0,0 +1,28 @@
199++--source include/have_innodb.inc
200++--disable_warnings
201++DROP TABLE IF EXISTS t1;
202++--enable_warnings
203++
204++SET autocommit=0;
205++CREATE TABLE t1 (a INT) ENGINE=InnoDB;
206++
207++--source include/percona_innodb_kill_idle_trx_show.inc
208++SET GLOBAL innodb_kill_idle_transaction=1;
209++--source include/percona_innodb_kill_idle_trx_show.inc
210++
211++BEGIN;
212++INSERT INTO t1 VALUES (1),(2),(3);
213++COMMIT;
214++SELECT * FROM t1;
215++
216++BEGIN;
217++INSERT INTO t1 VALUES (4),(5),(6);
218++sleep 3;
219++
220++--enable_reconnect
221++--error 2006 --error CR_SERVER_GONE_ERROR
222++SELECT * FROM t1;
223++SELECT * FROM t1;
224++DROP TABLE t1;
225++SET GLOBAL innodb_kill_idle_transaction=0;
226++--source include/percona_innodb_kill_idle_trx_show.inc
227+--- /dev/null
228++++ b/mysql-test/t/percona_innodb_kill_idle_trx_locks.test
229+@@ -0,0 +1,31 @@
230++--source include/have_innodb.inc
231++--disable_warnings
232++DROP TABLE IF EXISTS t1;
233++--enable_warnings
234++
235++SET autocommit=0;
236++CREATE TABLE t1 (a INT) ENGINE=InnoDB;
237++
238++--source include/percona_innodb_kill_idle_trx_show.inc
239++SET GLOBAL innodb_kill_idle_transaction=5;
240++--source include/percona_innodb_kill_idle_trx_show.inc
241++
242++connect (conn1,localhost,root,,);
243++connection conn1;
244++
245++BEGIN;
246++INSERT INTO t1 VALUES (1),(2),(3);
247++COMMIT;
248++SELECT * FROM t1;
249++
250++--echo ### Locking rows. Lock should be released when idle trx is killed.
251++BEGIN;
252++SELECT * FROM t1 FOR UPDATE;
253++
254++connection default;
255++UPDATE t1 set a=4;
256++
257++SELECT * FROM t1;
258++DROP TABLE t1;
259++SET GLOBAL innodb_kill_idle_transaction=0;
260++--source include/percona_innodb_kill_idle_trx_show.inc
261+--- /dev/null
262++++ b/mysql-test/r/percona_innodb_kill_idle_trx.result
263+@@ -0,0 +1,41 @@
264++DROP TABLE IF EXISTS t1;
265++SET autocommit=0;
266++CREATE TABLE t1 (a INT) ENGINE=InnoDB;
267++SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
268++Variable_name Value
269++innodb_kill_idle_transaction 0
270++SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
271++VARIABLE_NAME VARIABLE_VALUE
272++INNODB_KILL_IDLE_TRANSACTION 0
273++SET GLOBAL innodb_kill_idle_transaction=1;
274++SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
275++Variable_name Value
276++innodb_kill_idle_transaction 1
277++SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
278++VARIABLE_NAME VARIABLE_VALUE
279++INNODB_KILL_IDLE_TRANSACTION 1
280++BEGIN;
281++INSERT INTO t1 VALUES (1),(2),(3);
282++COMMIT;
283++SELECT * FROM t1;
284++a
285++1
286++2
287++3
288++BEGIN;
289++INSERT INTO t1 VALUES (4),(5),(6);
290++SELECT * FROM t1;
291++ERROR HY000: MySQL server has gone away
292++SELECT * FROM t1;
293++a
294++1
295++2
296++3
297++DROP TABLE t1;
298++SET GLOBAL innodb_kill_idle_transaction=0;
299++SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
300++Variable_name Value
301++innodb_kill_idle_transaction 0
302++SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
303++VARIABLE_NAME VARIABLE_VALUE
304++INNODB_KILL_IDLE_TRANSACTION 0
305+--- /dev/null
306++++ b/mysql-test/r/percona_innodb_kill_idle_trx_locks.result
307+@@ -0,0 +1,45 @@
308++DROP TABLE IF EXISTS t1;
309++SET autocommit=0;
310++CREATE TABLE t1 (a INT) ENGINE=InnoDB;
311++SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
312++Variable_name Value
313++innodb_kill_idle_transaction 0
314++SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
315++VARIABLE_NAME VARIABLE_VALUE
316++INNODB_KILL_IDLE_TRANSACTION 0
317++SET GLOBAL innodb_kill_idle_transaction=5;
318++SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
319++Variable_name Value
320++innodb_kill_idle_transaction 5
321++SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
322++VARIABLE_NAME VARIABLE_VALUE
323++INNODB_KILL_IDLE_TRANSACTION 5
324++BEGIN;
325++INSERT INTO t1 VALUES (1),(2),(3);
326++COMMIT;
327++SELECT * FROM t1;
328++a
329++1
330++2
331++3
332++### Locking rows. Lock should be released when idle trx is killed.
333++BEGIN;
334++SELECT * FROM t1 FOR UPDATE;
335++a
336++1
337++2
338++3
339++UPDATE t1 set a=4;
340++SELECT * FROM t1;
341++a
342++4
343++4
344++4
345++DROP TABLE t1;
346++SET GLOBAL innodb_kill_idle_transaction=0;
347++SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
348++Variable_name Value
349++innodb_kill_idle_transaction 0
350++SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
351++VARIABLE_NAME VARIABLE_VALUE
352++INNODB_KILL_IDLE_TRANSACTION 0
353
354=== modified file 'patches/mysql-test.diff'
355--- patches/mysql-test.diff 2011-08-04 21:14:39 +0000
356+++ patches/mysql-test.diff 2011-08-21 21:29:24 +0000
357@@ -1260,17 +1260,19 @@
358 delete from t2 where variable_name='innodb_change_buffering_debug';
359 update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_");
360 select variable_name as `There should be *no* long test name listed below:` from t2
361-@@ -11,13 +11,13 @@
362+@@ -11,13 +11,15 @@
363 select variable_name as `There should be *no* variables listed below:` from t2
364 left join t1 on variable_name=test_name where test_name is null;
365 There should be *no* variables listed below:
366 -INNODB_ROLLBACK_SEGMENTS
367 -INNODB_STATS_METHOD
368 INNODB_FILE_FORMAT_MAX
369++INNODB_KILL_IDLE_TRANSACTION
370 INNODB_LARGE_PREFIX
371 INNODB_ROLLBACK_SEGMENTS
372 INNODB_STATS_METHOD
373 INNODB_FILE_FORMAT_MAX
374++INNODB_KILL_IDLE_TRANSACTION
375 INNODB_LARGE_PREFIX
376 +INNODB_ROLLBACK_SEGMENTS
377 +INNODB_STATS_METHOD
378
379=== modified file 'patches/series'
380--- patches/series 2011-08-04 17:53:32 +0000
381+++ patches/series 2011-08-21 21:29:24 +0000
382@@ -53,3 +53,4 @@
383 utf8_general50_ci.patch
384 bug813587.patch
385 valgrind_zlib_suppression.patch
386+innodb_kill_idle_transaction.patch

Subscribers

People subscribed via source and target branches