Merge lp:~percona-dev/percona-server/5.1-kill_idle_transaction-innodb_fake_changes into lp:percona-server/5.1
- 5.1-kill_idle_transaction-innodb_fake_changes
- Merge into 5.1
Status: | Superseded |
---|---|
Proposed branch: | lp:~percona-dev/percona-server/5.1-kill_idle_transaction-innodb_fake_changes |
Merge into: | lp:percona-server/5.1 |
Diff against target: |
759 lines (+375/-76) 8 files modified
patches/innodb_buffer_pool_shm.patch (+3/-3) patches/innodb_deadlock_count.patch (+4/-4) patches/innodb_extend_slow.patch (+1/-1) patches/innodb_fake_changes.patch (+183/-35) patches/innodb_fast_shutdown.patch (+8/-8) patches/innodb_kill_idle_transaction.patch (+173/-24) patches/innodb_split_buf_pool_mutex.patch (+1/-1) patches/series (+2/-0) |
To merge this branch: | bzr merge lp:~percona-dev/percona-server/5.1-kill_idle_transaction-innodb_fake_changes |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stewart Smith (community) | Needs Fixing | ||
Review via email: mp+77238@code.launchpad.net |
This proposal has been superseded by a proposal from 2011-10-04.
Commit message
Description of the change
Added basic tests for innodb_
https:/
https:/
Stewart Smith (stewart) wrote : | # |
Yasufumi Kinoshita (yasufumi-kinoshita) wrote : | # |
I don't know how to treat is correct.
It is problem about error handling intention at mysqld.
InnoDB (this patch) is just returning error at ht->commit() at ha_commit_
At normal InnoDB, innobase_commit() always returns 0.
So mysqld might not be prepared for retuning error from ha->commit()?
It seems just to avoid the assertion that sandwitched by
"
thd->main_
...
thd->main_
"
But I don't know whether it is correct as mysqld intention.
Valentine Gostev (longbow) wrote : | # |
Submitted bug https:/
Preview Diff
1 | === modified file 'patches/innodb_buffer_pool_shm.patch' | |||
2 | --- patches/innodb_buffer_pool_shm.patch 2011-09-06 08:23:51 +0000 | |||
3 | +++ patches/innodb_buffer_pool_shm.patch 2011-10-04 05:52:29 +0000 | |||
4 | @@ -42,7 +42,7 @@ | |||
5 | 42 | 42 | ||
6 | 43 | static char* internal_innobase_data_file_path = NULL; | 43 | static char* internal_innobase_data_file_path = NULL; |
7 | 44 | 44 | ||
9 | 45 | @@ -2460,6 +2462,12 @@ | 45 | @@ -2468,6 +2470,12 @@ |
10 | 46 | 46 | ||
11 | 47 | srv_buf_pool_size = (ulint) innobase_buffer_pool_size; | 47 | srv_buf_pool_size = (ulint) innobase_buffer_pool_size; |
12 | 48 | 48 | ||
13 | @@ -55,7 +55,7 @@ | |||
14 | 55 | srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size; | 55 | srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size; |
15 | 56 | 56 | ||
16 | 57 | srv_n_file_io_threads = (ulint) innobase_file_io_threads; | 57 | srv_n_file_io_threads = (ulint) innobase_file_io_threads; |
18 | 58 | @@ -11472,6 +11480,16 @@ | 58 | @@ -11562,6 +11570,16 @@ |
19 | 59 | "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", | 59 | "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", |
20 | 60 | NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L); | 60 | NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L); |
21 | 61 | 61 | ||
22 | @@ -72,7 +72,7 @@ | |||
23 | 72 | static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, | 72 | static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, |
24 | 73 | PLUGIN_VAR_RQCMDARG, | 73 | PLUGIN_VAR_RQCMDARG, |
25 | 74 | "Helps in performance tuning in heavily concurrent environments.", | 74 | "Helps in performance tuning in heavily concurrent environments.", |
27 | 75 | @@ -11760,6 +11778,8 @@ | 75 | @@ -11859,6 +11877,8 @@ |
28 | 76 | MYSQL_SYSVAR(additional_mem_pool_size), | 76 | MYSQL_SYSVAR(additional_mem_pool_size), |
29 | 77 | MYSQL_SYSVAR(autoextend_increment), | 77 | MYSQL_SYSVAR(autoextend_increment), |
30 | 78 | MYSQL_SYSVAR(buffer_pool_size), | 78 | MYSQL_SYSVAR(buffer_pool_size), |
31 | 79 | 79 | ||
32 | === modified file 'patches/innodb_deadlock_count.patch' | |||
33 | --- patches/innodb_deadlock_count.patch 2011-09-06 08:23:51 +0000 | |||
34 | +++ patches/innodb_deadlock_count.patch 2011-10-04 05:52:29 +0000 | |||
35 | @@ -7,7 +7,7 @@ | |||
36 | 7 | # should be done or reviewed by the maintainer! | 7 | # should be done or reviewed by the maintainer! |
37 | 8 | --- a/storage/innodb_plugin/handler/ha_innodb.cc | 8 | --- a/storage/innodb_plugin/handler/ha_innodb.cc |
38 | 9 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc | 9 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc |
40 | 10 | @@ -566,6 +566,8 @@ | 10 | @@ -572,6 +572,8 @@ |
41 | 11 | (char*) &export_vars.innodb_data_written, SHOW_LONG}, | 11 | (char*) &export_vars.innodb_data_written, SHOW_LONG}, |
42 | 12 | {"dblwr_pages_written", | 12 | {"dblwr_pages_written", |
43 | 13 | (char*) &export_vars.innodb_dblwr_pages_written, SHOW_LONG}, | 13 | (char*) &export_vars.innodb_dblwr_pages_written, SHOW_LONG}, |
44 | @@ -28,7 +28,7 @@ | |||
45 | 28 | Gets the size of a lock struct. | 28 | Gets the size of a lock struct. |
46 | 29 | --- a/storage/innodb_plugin/include/srv0srv.h | 29 | --- a/storage/innodb_plugin/include/srv0srv.h |
47 | 30 | +++ b/storage/innodb_plugin/include/srv0srv.h | 30 | +++ b/storage/innodb_plugin/include/srv0srv.h |
49 | 31 | @@ -689,6 +689,7 @@ | 31 | @@ -690,6 +690,7 @@ |
50 | 32 | ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */ | 32 | ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */ |
51 | 33 | ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */ | 33 | ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */ |
52 | 34 | ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/ | 34 | ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/ |
53 | @@ -48,7 +48,7 @@ | |||
54 | 48 | break; | 48 | break; |
55 | 49 | --- a/storage/innodb_plugin/srv/srv0srv.c | 49 | --- a/storage/innodb_plugin/srv/srv0srv.c |
56 | 50 | +++ b/storage/innodb_plugin/srv/srv0srv.c | 50 | +++ b/storage/innodb_plugin/srv/srv0srv.c |
58 | 51 | @@ -444,7 +444,7 @@ | 51 | @@ -452,7 +452,7 @@ |
59 | 52 | static ulint srv_n_rows_updated_old = 0; | 52 | static ulint srv_n_rows_updated_old = 0; |
60 | 53 | static ulint srv_n_rows_deleted_old = 0; | 53 | static ulint srv_n_rows_deleted_old = 0; |
61 | 54 | static ulint srv_n_rows_read_old = 0; | 54 | static ulint srv_n_rows_read_old = 0; |
62 | @@ -57,7 +57,7 @@ | |||
63 | 57 | UNIV_INTERN ulint srv_n_lock_wait_count = 0; | 57 | UNIV_INTERN ulint srv_n_lock_wait_count = 0; |
64 | 58 | UNIV_INTERN ulint srv_n_lock_wait_current_count = 0; | 58 | UNIV_INTERN ulint srv_n_lock_wait_current_count = 0; |
65 | 59 | UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0; | 59 | UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0; |
67 | 60 | @@ -2155,6 +2155,8 @@ | 60 | @@ -2163,6 +2163,8 @@ |
68 | 61 | = UT_LIST_GET_LEN(buf_pool->flush_list); | 61 | = UT_LIST_GET_LEN(buf_pool->flush_list); |
69 | 62 | export_vars.innodb_buffer_pool_pages_free | 62 | export_vars.innodb_buffer_pool_pages_free |
70 | 63 | = UT_LIST_GET_LEN(buf_pool->free); | 63 | = UT_LIST_GET_LEN(buf_pool->free); |
71 | 64 | 64 | ||
72 | === modified file 'patches/innodb_extend_slow.patch' | |||
73 | --- patches/innodb_extend_slow.patch 2011-09-24 20:18:57 +0000 | |||
74 | +++ patches/innodb_extend_slow.patch 2011-10-04 05:52:29 +0000 | |||
75 | @@ -106,7 +106,7 @@ | |||
76 | 106 | @@ -2119,6 +2174,11 @@ | 106 | @@ -2119,6 +2174,11 @@ |
77 | 107 | ibool must_read; | 107 | ibool must_read; |
78 | 108 | ulint retries = 0; | 108 | ulint retries = 0; |
80 | 109 | mutex_t* block_mutex; | 109 | mutex_t* block_mutex = NULL; |
81 | 110 | + trx_t* trx = NULL; | 110 | + trx_t* trx = NULL; |
82 | 111 | + ulint sec; | 111 | + ulint sec; |
83 | 112 | + ulint ms; | 112 | + ulint ms; |
84 | 113 | 113 | ||
85 | === renamed file 'innodb_fake_changes.patch' => 'patches/innodb_fake_changes.patch' | |||
86 | --- innodb_fake_changes.patch 2011-07-07 13:02:19 +0000 | |||
87 | +++ patches/innodb_fake_changes.patch 2011-10-04 05:52:29 +0000 | |||
88 | @@ -5,9 +5,8 @@ | |||
89 | 5 | #!!! notice !!! | 5 | #!!! notice !!! |
90 | 6 | # Any small change to this file in the main branch | 6 | # Any small change to this file in the main branch |
91 | 7 | # should be done or reviewed by the maintainer! | 7 | # should be done or reviewed by the maintainer! |
95 | 8 | diff -ruN a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c | 8 | --- a/storage/innodb_plugin/btr/btr0cur.c |
96 | 9 | --- a/storage/innodb_plugin/btr/btr0cur.c 2011-07-07 19:38:25.840371992 +0900 | 9 | +++ b/storage/innodb_plugin/btr/btr0cur.c |
94 | 10 | +++ b/storage/innodb_plugin/btr/btr0cur.c 2011-07-07 20:09:02.125335731 +0900 | ||
97 | 11 | @@ -1046,6 +1046,11 @@ | 10 | @@ -1046,6 +1046,11 @@ |
98 | 12 | rec_t* rec; | 11 | rec_t* rec; |
99 | 13 | roll_ptr_t roll_ptr; | 12 | roll_ptr_t roll_ptr; |
100 | @@ -179,9 +178,8 @@ | |||
101 | 179 | block = btr_cur_get_block(cursor); | 178 | block = btr_cur_get_block(cursor); |
102 | 180 | rec = btr_cur_get_rec(cursor); | 179 | rec = btr_cur_get_rec(cursor); |
103 | 181 | 180 | ||
107 | 182 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc | 181 | --- a/storage/innodb_plugin/handler/ha_innodb.cc |
108 | 183 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2011-07-07 19:47:22.334541114 +0900 | 182 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc |
106 | 184 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2011-07-07 20:17:01.737288508 +0900 | ||
109 | 185 | @@ -367,6 +367,12 @@ | 183 | @@ -367,6 +367,12 @@ |
110 | 186 | "The value 3 regards innodb_flush_log_at_trx_commit (default).", | 184 | "The value 3 regards innodb_flush_log_at_trx_commit (default).", |
111 | 187 | NULL, NULL, 3, 0, 3, 0); | 185 | NULL, NULL, 3, 0, 3, 0); |
112 | @@ -208,11 +206,11 @@ | |||
113 | 208 | trx_search_latch_release_if_reserved(trx); | 206 | trx_search_latch_release_if_reserved(trx); |
114 | 209 | } | 207 | } |
115 | 210 | 208 | ||
117 | 211 | + if (trx->fake_changes) { | 209 | + if (trx->fake_changes && (all || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) { |
118 | 212 | + innobase_rollback(hton, thd, all); /* rollback implicitly */ | 210 | + innobase_rollback(hton, thd, all); /* rollback implicitly */ |
119 | 211 | + thd->main_da.reset_diagnostics_area(); /* because debug assertion code complains, if something left */ | ||
120 | 213 | + DBUG_RETURN(HA_ERR_WRONG_COMMAND); | 212 | + DBUG_RETURN(HA_ERR_WRONG_COMMAND); |
121 | 214 | + } | 213 | + } |
122 | 215 | + | ||
123 | 216 | /* The flag trx->active_trans is set to 1 in | 214 | /* The flag trx->active_trans is set to 1 in |
124 | 217 | 215 | ||
125 | 218 | 1. ::external_lock(), | 216 | 1. ::external_lock(), |
126 | @@ -297,9 +295,8 @@ | |||
127 | 297 | NULL | 295 | NULL |
128 | 298 | }; | 296 | }; |
129 | 299 | 297 | ||
133 | 300 | diff -ruN a/storage/innodb_plugin/handler/handler0alter.cc b/storage/innodb_plugin/handler/handler0alter.cc | 298 | --- a/storage/innodb_plugin/handler/handler0alter.cc |
134 | 301 | --- a/storage/innodb_plugin/handler/handler0alter.cc 2011-07-02 00:22:17.000000000 +0900 | 299 | +++ b/storage/innodb_plugin/handler/handler0alter.cc |
132 | 302 | +++ b/storage/innodb_plugin/handler/handler0alter.cc 2011-07-07 20:36:26.885315930 +0900 | ||
135 | 303 | @@ -652,6 +652,9 @@ | 300 | @@ -652,6 +652,9 @@ |
136 | 304 | /* In case MySQL calls this in the middle of a SELECT query, release | 301 | /* In case MySQL calls this in the middle of a SELECT query, release |
137 | 305 | possible adaptive hash latch to avoid deadlocks of threads. */ | 302 | possible adaptive hash latch to avoid deadlocks of threads. */ |
138 | @@ -348,9 +345,8 @@ | |||
139 | 348 | trx_start_if_not_started(trx); | 345 | trx_start_if_not_started(trx); |
140 | 349 | 346 | ||
141 | 350 | /* Flag this transaction as a dictionary operation, so that | 347 | /* Flag this transaction as a dictionary operation, so that |
145 | 351 | diff -ruN a/storage/innodb_plugin/ibuf/ibuf0ibuf.c b/storage/innodb_plugin/ibuf/ibuf0ibuf.c | 348 | --- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c |
146 | 352 | --- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c 2011-07-07 19:38:25.352373413 +0900 | 349 | +++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c |
144 | 353 | +++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c 2011-07-07 20:09:02.137334934 +0900 | ||
147 | 354 | @@ -2613,6 +2613,8 @@ | 350 | @@ -2613,6 +2613,8 @@ |
148 | 355 | 351 | ||
149 | 356 | ut_a(trx_sys_multiple_tablespace_format); | 352 | ut_a(trx_sys_multiple_tablespace_format); |
150 | @@ -360,9 +356,8 @@ | |||
151 | 360 | do_merge = FALSE; | 356 | do_merge = FALSE; |
152 | 361 | 357 | ||
153 | 362 | mutex_enter(&ibuf_mutex); | 358 | mutex_enter(&ibuf_mutex); |
157 | 363 | diff -ruN a/storage/innodb_plugin/include/trx0trx.h b/storage/innodb_plugin/include/trx0trx.h | 359 | --- a/storage/innodb_plugin/include/trx0trx.h |
158 | 364 | --- a/storage/innodb_plugin/include/trx0trx.h 2011-07-07 19:47:22.348325198 +0900 | 360 | +++ b/storage/innodb_plugin/include/trx0trx.h |
156 | 365 | +++ b/storage/innodb_plugin/include/trx0trx.h 2011-07-07 20:09:02.139302150 +0900 | ||
159 | 366 | @@ -509,6 +509,7 @@ | 361 | @@ -509,6 +509,7 @@ |
160 | 367 | 150 bytes in the undo log size as then | 362 | 150 bytes in the undo log size as then |
161 | 368 | we skip XA steps */ | 363 | we skip XA steps */ |
162 | @@ -371,9 +366,8 @@ | |||
163 | 371 | ulint flush_log_later;/* In 2PC, we hold the | 366 | ulint flush_log_later;/* In 2PC, we hold the |
164 | 372 | prepare_commit mutex across | 367 | prepare_commit mutex across |
165 | 373 | both phases. In that case, we | 368 | both phases. In that case, we |
169 | 374 | diff -ruN a/storage/innodb_plugin/lock/lock0lock.c b/storage/innodb_plugin/lock/lock0lock.c | 369 | --- a/storage/innodb_plugin/lock/lock0lock.c |
170 | 375 | --- a/storage/innodb_plugin/lock/lock0lock.c 2011-07-07 19:38:25.711373098 +0900 | 370 | +++ b/storage/innodb_plugin/lock/lock0lock.c |
168 | 376 | +++ b/storage/innodb_plugin/lock/lock0lock.c 2011-07-07 20:09:02.142335387 +0900 | ||
171 | 377 | @@ -3907,6 +3907,10 @@ | 371 | @@ -3907,6 +3907,10 @@ |
172 | 378 | 372 | ||
173 | 379 | trx = thr_get_trx(thr); | 373 | trx = thr_get_trx(thr); |
174 | @@ -441,9 +435,8 @@ | |||
175 | 441 | heap_no = page_rec_get_heap_no(rec); | 435 | heap_no = page_rec_get_heap_no(rec); |
176 | 442 | 436 | ||
177 | 443 | lock_mutex_enter_kernel(); | 437 | lock_mutex_enter_kernel(); |
181 | 444 | diff -ruN a/storage/innodb_plugin/que/que0que.c b/storage/innodb_plugin/que/que0que.c | 438 | --- a/storage/innodb_plugin/que/que0que.c |
182 | 445 | --- a/storage/innodb_plugin/que/que0que.c 2011-07-07 19:38:25.512373167 +0900 | 439 | +++ b/storage/innodb_plugin/que/que0que.c |
180 | 446 | +++ b/storage/innodb_plugin/que/que0que.c 2011-07-07 20:09:02.144331758 +0900 | ||
183 | 447 | @@ -1418,6 +1418,12 @@ | 440 | @@ -1418,6 +1418,12 @@ |
184 | 448 | 441 | ||
185 | 449 | ut_a(trx->error_state == DB_SUCCESS); | 442 | ut_a(trx->error_state == DB_SUCCESS); |
186 | @@ -457,9 +450,8 @@ | |||
187 | 457 | if (reserve_dict_mutex) { | 450 | if (reserve_dict_mutex) { |
188 | 458 | mutex_enter(&dict_sys->mutex); | 451 | mutex_enter(&dict_sys->mutex); |
189 | 459 | } | 452 | } |
193 | 460 | diff -ruN a/storage/innodb_plugin/row/row0ins.c b/storage/innodb_plugin/row/row0ins.c | 453 | --- a/storage/innodb_plugin/row/row0ins.c |
194 | 461 | --- a/storage/innodb_plugin/row/row0ins.c 2011-07-07 19:38:25.925373011 +0900 | 454 | +++ b/storage/innodb_plugin/row/row0ins.c |
192 | 462 | +++ b/storage/innodb_plugin/row/row0ins.c 2011-07-07 20:09:02.147335402 +0900 | ||
195 | 463 | @@ -1512,6 +1512,11 @@ | 455 | @@ -1512,6 +1512,11 @@ |
196 | 464 | if (UNIV_LIKELY_NULL(heap)) { | 456 | if (UNIV_LIKELY_NULL(heap)) { |
197 | 465 | mem_heap_free(heap); | 457 | mem_heap_free(heap); |
198 | @@ -513,9 +505,8 @@ | |||
199 | 513 | mtr_start(&mtr); | 505 | mtr_start(&mtr); |
200 | 514 | 506 | ||
201 | 515 | btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, | 507 | btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, |
205 | 516 | diff -ruN a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c | 508 | --- a/storage/innodb_plugin/row/row0mysql.c |
206 | 517 | --- a/storage/innodb_plugin/row/row0mysql.c 2011-07-07 19:38:26.139298610 +0900 | 509 | +++ b/storage/innodb_plugin/row/row0mysql.c |
204 | 518 | +++ b/storage/innodb_plugin/row/row0mysql.c 2011-07-07 20:09:02.149334904 +0900 | ||
207 | 519 | @@ -1189,6 +1189,7 @@ | 510 | @@ -1189,6 +1189,7 @@ |
208 | 520 | prebuilt->table->stat_n_rows--; | 511 | prebuilt->table->stat_n_rows--; |
209 | 521 | } | 512 | } |
210 | @@ -540,9 +531,8 @@ | |||
211 | 540 | row_update_statistics_if_needed(table); | 531 | row_update_statistics_if_needed(table); |
212 | 541 | 532 | ||
213 | 542 | return(err); | 533 | return(err); |
217 | 543 | diff -ruN a/storage/innodb_plugin/row/row0upd.c b/storage/innodb_plugin/row/row0upd.c | 534 | --- a/storage/innodb_plugin/row/row0upd.c |
218 | 544 | --- a/storage/innodb_plugin/row/row0upd.c 2011-07-07 19:38:25.530295605 +0900 | 535 | +++ b/storage/innodb_plugin/row/row0upd.c |
216 | 545 | +++ b/storage/innodb_plugin/row/row0upd.c 2011-07-07 20:09:02.152334950 +0900 | ||
219 | 546 | @@ -1591,8 +1591,9 @@ | 536 | @@ -1591,8 +1591,9 @@ |
220 | 547 | 537 | ||
221 | 548 | mtr_start(&mtr); | 538 | mtr_start(&mtr); |
222 | @@ -606,9 +596,8 @@ | |||
223 | 606 | 596 | ||
224 | 607 | if (!success) { | 597 | if (!success) { |
225 | 608 | err = DB_RECORD_NOT_FOUND; | 598 | err = DB_RECORD_NOT_FOUND; |
229 | 609 | diff -ruN a/storage/innodb_plugin/trx/trx0trx.c b/storage/innodb_plugin/trx/trx0trx.c | 599 | --- a/storage/innodb_plugin/trx/trx0trx.c |
230 | 610 | --- a/storage/innodb_plugin/trx/trx0trx.c 2011-07-07 19:47:22.358333765 +0900 | 600 | +++ b/storage/innodb_plugin/trx/trx0trx.c |
228 | 611 | +++ b/storage/innodb_plugin/trx/trx0trx.c 2011-07-07 20:09:02.156330704 +0900 | ||
231 | 612 | @@ -114,6 +114,8 @@ | 601 | @@ -114,6 +114,8 @@ |
232 | 613 | 602 | ||
233 | 614 | trx->flush_log_at_trx_commit_session = 3; /* means to use innodb_flush_log_at_trx_commit value */ | 603 | trx->flush_log_at_trx_commit_session = 3; /* means to use innodb_flush_log_at_trx_commit value */ |
234 | @@ -618,3 +607,162 @@ | |||
235 | 618 | trx->check_foreigns = TRUE; | 607 | trx->check_foreigns = TRUE; |
236 | 619 | trx->check_unique_secondary = TRUE; | 608 | trx->check_unique_secondary = TRUE; |
237 | 620 | 609 | ||
238 | 610 | --- /dev/null | ||
239 | 611 | +++ b/mysql-test/r/percona_innodb_fake_changes.result | ||
240 | 612 | @@ -0,0 +1,55 @@ | ||
241 | 613 | +DROP TABLE IF EXISTS t1; | ||
242 | 614 | +# Checking variables | ||
243 | 615 | +SHOW VARIABLES LIKE 'innodb_fake_changes'; | ||
244 | 616 | +Variable_name Value | ||
245 | 617 | +innodb_fake_changes OFF | ||
246 | 618 | +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes'; | ||
247 | 619 | +VARIABLE_VALUE | ||
248 | 620 | +OFF | ||
249 | 621 | +SET innodb_fake_changes=1; | ||
250 | 622 | +SHOW VARIABLES LIKE 'innodb_fake_changes'; | ||
251 | 623 | +Variable_name Value | ||
252 | 624 | +innodb_fake_changes ON | ||
253 | 625 | +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes'; | ||
254 | 626 | +VARIABLE_VALUE | ||
255 | 627 | +ON | ||
256 | 628 | +SET innodb_fake_changes=default; | ||
257 | 629 | +SHOW VARIABLES LIKE 'innodb_fake_changes'; | ||
258 | 630 | +Variable_name Value | ||
259 | 631 | +innodb_fake_changes OFF | ||
260 | 632 | +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes'; | ||
261 | 633 | +VARIABLE_VALUE | ||
262 | 634 | +OFF | ||
263 | 635 | +# Explicit COMMIT should fail when innodb_fake_changes is enabled | ||
264 | 636 | +# DML should be fine | ||
265 | 637 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
266 | 638 | +INSERT INTO t1 VALUES (1); | ||
267 | 639 | +SET autocommit=0; | ||
268 | 640 | +SET innodb_fake_changes=1; | ||
269 | 641 | +BEGIN; | ||
270 | 642 | +INSERT INTO t1 VALUES (2); | ||
271 | 643 | +UPDATE t1 SET a=0; | ||
272 | 644 | +DELETE FROM t1 LIMIT 1; | ||
273 | 645 | +SELECT * FROM t1; | ||
274 | 646 | +a | ||
275 | 647 | +1 | ||
276 | 648 | +COMMIT; | ||
277 | 649 | +ERROR HY000: Got error 131 during COMMIT | ||
278 | 650 | +SET innodb_fake_changes=default; | ||
279 | 651 | +DROP TABLE t1; | ||
280 | 652 | +# DDL must result in error | ||
281 | 653 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
282 | 654 | +SET autocommit=0; | ||
283 | 655 | +SET innodb_fake_changes=1; | ||
284 | 656 | +BEGIN; | ||
285 | 657 | +CREATE TABLE t2 (a INT) ENGINE=InnoDB; | ||
286 | 658 | +ERROR HY000: Can't create table 'test.t2' (errno: 131) | ||
287 | 659 | +DROP TABLE t1; | ||
288 | 660 | +ERROR 42S02: Unknown table 't1' | ||
289 | 661 | +TRUNCATE TABLE t1; | ||
290 | 662 | +ERROR HY000: Got error 131 during COMMIT | ||
291 | 663 | +ALTER TABLE t1 ENGINE=MyISAM; | ||
292 | 664 | +ERROR HY000: Got error 131 during COMMIT | ||
293 | 665 | +ROLLBACK; | ||
294 | 666 | +SET innodb_fake_changes=default; | ||
295 | 667 | +DROP TABLE t1; | ||
296 | 668 | --- /dev/null | ||
297 | 669 | +++ b/mysql-test/r/percona_innodb_fake_changes_locks.result | ||
298 | 670 | @@ -0,0 +1,19 @@ | ||
299 | 671 | +DROP TABLE IF EXISTS t1; | ||
300 | 672 | +# Verifying that X_LOCK not acquired | ||
301 | 673 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
302 | 674 | +INSERT INTO t1 VALUES (1); | ||
303 | 675 | +SET autocommit=0; | ||
304 | 676 | +SET innodb_fake_changes=1; | ||
305 | 677 | +BEGIN; | ||
306 | 678 | +SELECT * FROM t1 FOR UPDATE; | ||
307 | 679 | +a | ||
308 | 680 | +1 | ||
309 | 681 | +SET innodb_lock_wait_timeout=3; | ||
310 | 682 | +UPDATE t1 SET a=2; | ||
311 | 683 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
312 | 684 | +SELECT * FROM t1 LOCK IN SHARE MODE; | ||
313 | 685 | +a | ||
314 | 686 | +1 | ||
315 | 687 | +ROLLBACK; | ||
316 | 688 | +SET innodb_fake_changes=default; | ||
317 | 689 | +DROP TABLE t1; | ||
318 | 690 | --- /dev/null | ||
319 | 691 | +++ b/mysql-test/t/percona_innodb_fake_changes.test | ||
320 | 692 | @@ -0,0 +1,49 @@ | ||
321 | 693 | +--source include/have_innodb_plugin.inc | ||
322 | 694 | + | ||
323 | 695 | +--disable_warnings | ||
324 | 696 | +DROP TABLE IF EXISTS t1; | ||
325 | 697 | +--enable_warnings | ||
326 | 698 | + | ||
327 | 699 | + | ||
328 | 700 | +--echo # Checking variables | ||
329 | 701 | +SHOW VARIABLES LIKE 'innodb_fake_changes'; | ||
330 | 702 | +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes'; | ||
331 | 703 | +SET innodb_fake_changes=1; | ||
332 | 704 | +SHOW VARIABLES LIKE 'innodb_fake_changes'; | ||
333 | 705 | +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes'; | ||
334 | 706 | +SET innodb_fake_changes=default; | ||
335 | 707 | +SHOW VARIABLES LIKE 'innodb_fake_changes'; | ||
336 | 708 | +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes'; | ||
337 | 709 | + | ||
338 | 710 | +--echo # Explicit COMMIT should fail when innodb_fake_changes is enabled | ||
339 | 711 | +--echo # DML should be fine | ||
340 | 712 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
341 | 713 | +INSERT INTO t1 VALUES (1); | ||
342 | 714 | +SET autocommit=0; | ||
343 | 715 | +SET innodb_fake_changes=1; | ||
344 | 716 | +BEGIN; | ||
345 | 717 | +INSERT INTO t1 VALUES (2); | ||
346 | 718 | +UPDATE t1 SET a=0; | ||
347 | 719 | +DELETE FROM t1 LIMIT 1; | ||
348 | 720 | +SELECT * FROM t1; | ||
349 | 721 | +--error 1180 | ||
350 | 722 | +COMMIT; | ||
351 | 723 | +SET innodb_fake_changes=default; | ||
352 | 724 | +DROP TABLE t1; | ||
353 | 725 | + | ||
354 | 726 | +--echo # DDL must result in error | ||
355 | 727 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
356 | 728 | +SET autocommit=0; | ||
357 | 729 | +SET innodb_fake_changes=1; | ||
358 | 730 | +BEGIN; | ||
359 | 731 | +--error 1005 | ||
360 | 732 | +CREATE TABLE t2 (a INT) ENGINE=InnoDB; | ||
361 | 733 | +--error 1051 | ||
362 | 734 | +DROP TABLE t1; | ||
363 | 735 | +--error 1180 | ||
364 | 736 | +TRUNCATE TABLE t1; | ||
365 | 737 | +--error 1180 | ||
366 | 738 | +ALTER TABLE t1 ENGINE=MyISAM; | ||
367 | 739 | +ROLLBACK; | ||
368 | 740 | +SET innodb_fake_changes=default; | ||
369 | 741 | +DROP TABLE t1; | ||
370 | 742 | --- /dev/null | ||
371 | 743 | +++ b/mysql-test/t/percona_innodb_fake_changes_locks.test | ||
372 | 744 | @@ -0,0 +1,24 @@ | ||
373 | 745 | +--source include/have_innodb_plugin.inc | ||
374 | 746 | + | ||
375 | 747 | +--disable_warnings | ||
376 | 748 | +DROP TABLE IF EXISTS t1; | ||
377 | 749 | +--enable_warnings | ||
378 | 750 | + | ||
379 | 751 | +--echo # Verifying that X_LOCK not acquired | ||
380 | 752 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
381 | 753 | +INSERT INTO t1 VALUES (1); | ||
382 | 754 | +--connect (conn1,localhost,root,,) | ||
383 | 755 | +--connection conn1 | ||
384 | 756 | +SET autocommit=0; | ||
385 | 757 | +SET innodb_fake_changes=1; | ||
386 | 758 | +BEGIN; | ||
387 | 759 | +SELECT * FROM t1 FOR UPDATE; | ||
388 | 760 | +--connection default | ||
389 | 761 | +SET innodb_lock_wait_timeout=3; | ||
390 | 762 | +--error 1205 | ||
391 | 763 | +UPDATE t1 SET a=2; | ||
392 | 764 | +SELECT * FROM t1 LOCK IN SHARE MODE; | ||
393 | 765 | +--connection conn1 | ||
394 | 766 | +ROLLBACK; | ||
395 | 767 | +SET innodb_fake_changes=default; | ||
396 | 768 | +DROP TABLE t1; | ||
397 | 621 | 769 | ||
398 | === modified file 'patches/innodb_fast_shutdown.patch' | |||
399 | --- patches/innodb_fast_shutdown.patch 2011-07-30 22:04:31 +0000 | |||
400 | +++ patches/innodb_fast_shutdown.patch 2011-10-04 05:52:29 +0000 | |||
401 | @@ -159,7 +159,7 @@ | |||
402 | 159 | 159 | ||
403 | 160 | --- a/storage/innodb_plugin/srv/srv0srv.c | 160 | --- a/storage/innodb_plugin/srv/srv0srv.c |
404 | 161 | +++ b/storage/innodb_plugin/srv/srv0srv.c | 161 | +++ b/storage/innodb_plugin/srv/srv0srv.c |
406 | 162 | @@ -708,6 +708,8 @@ | 162 | @@ -716,6 +716,8 @@ |
407 | 163 | 163 | ||
408 | 164 | UNIV_INTERN os_event_t srv_lock_timeout_thread_event; | 164 | UNIV_INTERN os_event_t srv_lock_timeout_thread_event; |
409 | 165 | 165 | ||
410 | @@ -168,7 +168,7 @@ | |||
411 | 168 | UNIV_INTERN srv_sys_t* srv_sys = NULL; | 168 | UNIV_INTERN srv_sys_t* srv_sys = NULL; |
412 | 169 | 169 | ||
413 | 170 | /* padding to prevent other memory update hotspots from residing on | 170 | /* padding to prevent other memory update hotspots from residing on |
415 | 171 | @@ -1013,6 +1015,7 @@ | 171 | @@ -1021,6 +1023,7 @@ |
416 | 172 | } | 172 | } |
417 | 173 | 173 | ||
418 | 174 | srv_lock_timeout_thread_event = os_event_create(NULL); | 174 | srv_lock_timeout_thread_event = os_event_create(NULL); |
419 | @@ -176,7 +176,7 @@ | |||
420 | 176 | 176 | ||
421 | 177 | for (i = 0; i < SRV_MASTER + 1; i++) { | 177 | for (i = 0; i < SRV_MASTER + 1; i++) { |
422 | 178 | srv_n_threads_active[i] = 0; | 178 | srv_n_threads_active[i] = 0; |
424 | 179 | @@ -2240,7 +2243,7 @@ | 179 | @@ -2248,7 +2251,7 @@ |
425 | 180 | /* Wake up every 5 seconds to see if we need to print | 180 | /* Wake up every 5 seconds to see if we need to print |
426 | 181 | monitor information. */ | 181 | monitor information. */ |
427 | 182 | 182 | ||
428 | @@ -185,7 +185,7 @@ | |||
429 | 185 | 185 | ||
430 | 186 | current_time = time(NULL); | 186 | current_time = time(NULL); |
431 | 187 | 187 | ||
433 | 188 | @@ -2382,7 +2385,7 @@ | 188 | @@ -2390,7 +2393,7 @@ |
434 | 189 | /* When someone is waiting for a lock, we wake up every second | 189 | /* When someone is waiting for a lock, we wake up every second |
435 | 190 | and check if a timeout has passed for a lock wait */ | 190 | and check if a timeout has passed for a lock wait */ |
436 | 191 | 191 | ||
437 | @@ -194,7 +194,7 @@ | |||
438 | 194 | 194 | ||
439 | 195 | srv_lock_timeout_active = TRUE; | 195 | srv_lock_timeout_active = TRUE; |
440 | 196 | 196 | ||
442 | 197 | @@ -2556,7 +2559,7 @@ | 197 | @@ -2594,7 +2597,7 @@ |
443 | 198 | 198 | ||
444 | 199 | fflush(stderr); | 199 | fflush(stderr); |
445 | 200 | 200 | ||
446 | @@ -203,7 +203,7 @@ | |||
447 | 203 | 203 | ||
448 | 204 | if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) { | 204 | if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) { |
449 | 205 | 205 | ||
451 | 206 | @@ -2600,7 +2603,7 @@ | 206 | @@ -2638,7 +2641,7 @@ |
452 | 207 | last_dump_time = time(NULL); | 207 | last_dump_time = time(NULL); |
453 | 208 | 208 | ||
454 | 209 | loop: | 209 | loop: |
455 | @@ -212,7 +212,7 @@ | |||
456 | 212 | 212 | ||
457 | 213 | if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { | 213 | if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { |
458 | 214 | goto exit_func; | 214 | goto exit_func; |
460 | 215 | @@ -2783,7 +2786,7 @@ | 215 | @@ -2821,7 +2824,7 @@ |
461 | 216 | if (!skip_sleep) { | 216 | if (!skip_sleep) { |
462 | 217 | if (next_itr_time > cur_time) { | 217 | if (next_itr_time > cur_time) { |
463 | 218 | 218 | ||
464 | @@ -221,7 +221,7 @@ | |||
465 | 221 | srv_main_sleeps++; | 221 | srv_main_sleeps++; |
466 | 222 | 222 | ||
467 | 223 | /* | 223 | /* |
469 | 224 | @@ -3490,9 +3493,10 @@ | 224 | @@ -3528,9 +3531,10 @@ |
470 | 225 | mutex_exit(&kernel_mutex); | 225 | mutex_exit(&kernel_mutex); |
471 | 226 | 226 | ||
472 | 227 | sleep_ms = 10; | 227 | sleep_ms = 10; |
473 | 228 | 228 | ||
474 | === renamed file 'innodb_kill_idle_transaction.patch' => 'patches/innodb_kill_idle_transaction.patch' | |||
475 | --- innodb_kill_idle_transaction.patch 2011-07-07 13:02:19 +0000 | |||
476 | +++ patches/innodb_kill_idle_transaction.patch 2011-10-04 05:52:29 +0000 | |||
477 | @@ -5,9 +5,8 @@ | |||
478 | 5 | #!!! notice !!! | 5 | #!!! notice !!! |
479 | 6 | # Any small change to this file in the main branch | 6 | # Any small change to this file in the main branch |
480 | 7 | # should be done or reviewed by the maintainer! | 7 | # should be done or reviewed by the maintainer! |
484 | 8 | diff -ruN a/include/mysql/plugin.h b/include/mysql/plugin.h | 8 | --- a/include/mysql/plugin.h |
485 | 9 | --- a/include/mysql/plugin.h 2011-07-07 19:38:24.650374103 +0900 | 9 | +++ b/include/mysql/plugin.h |
483 | 10 | +++ b/include/mysql/plugin.h 2011-07-07 19:39:44.611713196 +0900 | ||
486 | 11 | @@ -845,6 +845,12 @@ | 10 | @@ -845,6 +845,12 @@ |
487 | 12 | */ | 11 | */ |
488 | 13 | void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton, | 12 | void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton, |
489 | @@ -21,9 +20,8 @@ | |||
490 | 21 | #ifdef __cplusplus | 20 | #ifdef __cplusplus |
491 | 22 | } | 21 | } |
492 | 23 | #endif | 22 | #endif |
496 | 24 | diff -ruN a/include/mysql/plugin.h.pp b/include/mysql/plugin.h.pp | 23 | --- a/include/mysql/plugin.h.pp |
497 | 25 | --- a/include/mysql/plugin.h.pp 2011-07-07 19:38:24.423414787 +0900 | 24 | +++ b/include/mysql/plugin.h.pp |
495 | 26 | +++ b/include/mysql/plugin.h.pp 2011-07-07 19:39:44.615372555 +0900 | ||
498 | 27 | @@ -150,3 +150,6 @@ | 25 | @@ -150,3 +150,6 @@ |
499 | 28 | void *thd_get_ha_data(const void* thd, const struct handlerton *hton); | 26 | void *thd_get_ha_data(const void* thd, const struct handlerton *hton); |
500 | 29 | void thd_set_ha_data(void* thd, const struct handlerton *hton, | 27 | void thd_set_ha_data(void* thd, const struct handlerton *hton, |
501 | @@ -31,9 +29,8 @@ | |||
502 | 31 | +int thd_command(const void* thd); | 29 | +int thd_command(const void* thd); |
503 | 32 | +long long thd_start_time(const void* thd); | 30 | +long long thd_start_time(const void* thd); |
504 | 33 | +void thd_kill(void* thd); | 31 | +void thd_kill(void* thd); |
508 | 34 | diff -ruN a/sql/sql_class.cc b/sql/sql_class.cc | 32 | --- a/sql/sql_class.cc |
509 | 35 | --- a/sql/sql_class.cc 2011-07-07 19:38:24.999372326 +0900 | 33 | +++ b/sql/sql_class.cc |
507 | 36 | +++ b/sql/sql_class.cc 2011-07-07 19:39:44.619370533 +0900 | ||
510 | 37 | @@ -468,6 +468,26 @@ | 34 | @@ -468,6 +468,26 @@ |
511 | 38 | return buffer; | 35 | return buffer; |
512 | 39 | } | 36 | } |
513 | @@ -61,9 +58,8 @@ | |||
514 | 61 | 58 | ||
515 | 62 | /** | 59 | /** |
516 | 63 | Implementation of Drop_table_error_handler::handle_error(). | 60 | Implementation of Drop_table_error_handler::handle_error(). |
520 | 64 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc | 61 | --- a/storage/innodb_plugin/handler/ha_innodb.cc |
521 | 65 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2011-07-07 19:38:26.162373407 +0900 | 62 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc |
519 | 66 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2011-07-07 19:39:44.625370650 +0900 | ||
522 | 67 | @@ -2511,6 +2511,10 @@ | 63 | @@ -2511,6 +2511,10 @@ |
523 | 68 | 64 | ||
524 | 69 | innobase_commit_concurrency_init_default(); | 65 | innobase_commit_concurrency_init_default(); |
525 | @@ -148,9 +144,8 @@ | |||
526 | 148 | MYSQL_SYSVAR(data_file_path), | 144 | MYSQL_SYSVAR(data_file_path), |
527 | 149 | MYSQL_SYSVAR(doublewrite_file), | 145 | MYSQL_SYSVAR(doublewrite_file), |
528 | 150 | MYSQL_SYSVAR(data_home_dir), | 146 | MYSQL_SYSVAR(data_home_dir), |
532 | 151 | diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h | 147 | --- a/storage/innodb_plugin/include/srv0srv.h |
533 | 152 | --- a/storage/innodb_plugin/include/srv0srv.h 2011-07-07 19:38:26.128372970 +0900 | 148 | +++ b/storage/innodb_plugin/include/srv0srv.h |
531 | 153 | +++ b/storage/innodb_plugin/include/srv0srv.h 2011-07-07 19:39:44.646824971 +0900 | ||
534 | 154 | @@ -281,6 +281,7 @@ | 149 | @@ -281,6 +281,7 @@ |
535 | 155 | extern ulint srv_activity_count; | 150 | extern ulint srv_activity_count; |
536 | 156 | extern ulint srv_fatal_semaphore_wait_threshold; | 151 | extern ulint srv_fatal_semaphore_wait_threshold; |
537 | @@ -159,9 +154,8 @@ | |||
538 | 159 | 154 | ||
539 | 160 | extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, | 155 | extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, |
540 | 161 | query threads, and lock table: we allocate | 156 | query threads, and lock table: we allocate |
544 | 162 | diff -ruN a/storage/innodb_plugin/include/trx0trx.h b/storage/innodb_plugin/include/trx0trx.h | 157 | --- a/storage/innodb_plugin/include/trx0trx.h |
545 | 163 | --- a/storage/innodb_plugin/include/trx0trx.h 2011-07-07 19:38:25.705377859 +0900 | 158 | +++ b/storage/innodb_plugin/include/trx0trx.h |
543 | 164 | +++ b/storage/innodb_plugin/include/trx0trx.h 2011-07-07 19:39:44.650304314 +0900 | ||
546 | 165 | @@ -600,6 +600,8 @@ | 159 | @@ -600,6 +600,8 @@ |
547 | 166 | ulint mysql_process_no;/* since in Linux, 'top' reports | 160 | ulint mysql_process_no;/* since in Linux, 'top' reports |
548 | 167 | process id's and not thread id's, we | 161 | process id's and not thread id's, we |
549 | @@ -171,9 +165,8 @@ | |||
550 | 171 | /*------------------------------*/ | 165 | /*------------------------------*/ |
551 | 172 | ulint n_mysql_tables_in_use; /* number of Innobase tables | 166 | ulint n_mysql_tables_in_use; /* number of Innobase tables |
552 | 173 | used in the processing of the current | 167 | used in the processing of the current |
556 | 174 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c | 168 | --- a/storage/innodb_plugin/srv/srv0srv.c |
557 | 175 | --- a/storage/innodb_plugin/srv/srv0srv.c 2011-07-07 19:38:26.147372081 +0900 | 169 | +++ b/storage/innodb_plugin/srv/srv0srv.c |
555 | 176 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2011-07-07 19:39:44.658303810 +0900 | ||
558 | 177 | @@ -86,6 +86,11 @@ | 170 | @@ -86,6 +86,11 @@ |
559 | 178 | #include "trx0i_s.h" | 171 | #include "trx0i_s.h" |
560 | 179 | #include "os0sync.h" /* for HAVE_ATOMIC_BUILTINS */ | 172 | #include "os0sync.h" /* for HAVE_ATOMIC_BUILTINS */ |
561 | @@ -233,9 +226,8 @@ | |||
562 | 233 | /* Flush stderr so that a database user gets the output | 226 | /* Flush stderr so that a database user gets the output |
563 | 234 | to possible MySQL error file */ | 227 | to possible MySQL error file */ |
564 | 235 | 228 | ||
568 | 236 | diff -ruN a/storage/innodb_plugin/trx/trx0trx.c b/storage/innodb_plugin/trx/trx0trx.c | 229 | --- a/storage/innodb_plugin/trx/trx0trx.c |
569 | 237 | --- a/storage/innodb_plugin/trx/trx0trx.c 2011-07-07 19:38:25.723372433 +0900 | 230 | +++ b/storage/innodb_plugin/trx/trx0trx.c |
567 | 238 | +++ b/storage/innodb_plugin/trx/trx0trx.c 2011-07-07 19:39:44.665304098 +0900 | ||
570 | 239 | @@ -137,6 +137,9 @@ | 231 | @@ -137,6 +137,9 @@ |
571 | 240 | trx->mysql_relay_log_file_name = ""; | 232 | trx->mysql_relay_log_file_name = ""; |
572 | 241 | trx->mysql_relay_log_pos = 0; | 233 | trx->mysql_relay_log_pos = 0; |
573 | @@ -246,3 +238,160 @@ | |||
574 | 246 | mutex_create(&trx->undo_mutex, SYNC_TRX_UNDO); | 238 | mutex_create(&trx->undo_mutex, SYNC_TRX_UNDO); |
575 | 247 | 239 | ||
576 | 248 | trx->rseg = NULL; | 240 | trx->rseg = NULL; |
577 | 241 | --- /dev/null | ||
578 | 242 | +++ b/mysql-test/r/percona_innodb_kill_idle_trx.result | ||
579 | 243 | @@ -0,0 +1,41 @@ | ||
580 | 244 | +DROP TABLE IF EXISTS t1; | ||
581 | 245 | +SET autocommit=0; | ||
582 | 246 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
583 | 247 | +SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction'; | ||
584 | 248 | +Variable_name Value | ||
585 | 249 | +innodb_kill_idle_transaction 0 | ||
586 | 250 | +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction'; | ||
587 | 251 | +VARIABLE_NAME VARIABLE_VALUE | ||
588 | 252 | +INNODB_KILL_IDLE_TRANSACTION 0 | ||
589 | 253 | +SET GLOBAL innodb_kill_idle_transaction=1; | ||
590 | 254 | +SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction'; | ||
591 | 255 | +Variable_name Value | ||
592 | 256 | +innodb_kill_idle_transaction 1 | ||
593 | 257 | +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction'; | ||
594 | 258 | +VARIABLE_NAME VARIABLE_VALUE | ||
595 | 259 | +INNODB_KILL_IDLE_TRANSACTION 1 | ||
596 | 260 | +BEGIN; | ||
597 | 261 | +INSERT INTO t1 VALUES (1),(2),(3); | ||
598 | 262 | +COMMIT; | ||
599 | 263 | +SELECT * FROM t1; | ||
600 | 264 | +a | ||
601 | 265 | +1 | ||
602 | 266 | +2 | ||
603 | 267 | +3 | ||
604 | 268 | +BEGIN; | ||
605 | 269 | +INSERT INTO t1 VALUES (4),(5),(6); | ||
606 | 270 | +SELECT * FROM t1; | ||
607 | 271 | +ERROR HY000: MySQL server has gone away | ||
608 | 272 | +SELECT * FROM t1; | ||
609 | 273 | +a | ||
610 | 274 | +1 | ||
611 | 275 | +2 | ||
612 | 276 | +3 | ||
613 | 277 | +DROP TABLE t1; | ||
614 | 278 | +SET GLOBAL innodb_kill_idle_transaction=0; | ||
615 | 279 | +SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction'; | ||
616 | 280 | +Variable_name Value | ||
617 | 281 | +innodb_kill_idle_transaction 0 | ||
618 | 282 | +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction'; | ||
619 | 283 | +VARIABLE_NAME VARIABLE_VALUE | ||
620 | 284 | +INNODB_KILL_IDLE_TRANSACTION 0 | ||
621 | 285 | --- /dev/null | ||
622 | 286 | +++ b/mysql-test/r/percona_innodb_kill_idle_trx_locks.result | ||
623 | 287 | @@ -0,0 +1,45 @@ | ||
624 | 288 | +DROP TABLE IF EXISTS t1; | ||
625 | 289 | +SET autocommit=0; | ||
626 | 290 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
627 | 291 | +SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction'; | ||
628 | 292 | +Variable_name Value | ||
629 | 293 | +innodb_kill_idle_transaction 0 | ||
630 | 294 | +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction'; | ||
631 | 295 | +VARIABLE_NAME VARIABLE_VALUE | ||
632 | 296 | +INNODB_KILL_IDLE_TRANSACTION 0 | ||
633 | 297 | +SET GLOBAL innodb_kill_idle_transaction=5; | ||
634 | 298 | +SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction'; | ||
635 | 299 | +Variable_name Value | ||
636 | 300 | +innodb_kill_idle_transaction 5 | ||
637 | 301 | +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction'; | ||
638 | 302 | +VARIABLE_NAME VARIABLE_VALUE | ||
639 | 303 | +INNODB_KILL_IDLE_TRANSACTION 5 | ||
640 | 304 | +BEGIN; | ||
641 | 305 | +INSERT INTO t1 VALUES (1),(2),(3); | ||
642 | 306 | +COMMIT; | ||
643 | 307 | +SELECT * FROM t1; | ||
644 | 308 | +a | ||
645 | 309 | +1 | ||
646 | 310 | +2 | ||
647 | 311 | +3 | ||
648 | 312 | +### Locking rows. Lock should be released when idle trx is killed. | ||
649 | 313 | +BEGIN; | ||
650 | 314 | +SELECT * FROM t1 FOR UPDATE; | ||
651 | 315 | +a | ||
652 | 316 | +1 | ||
653 | 317 | +2 | ||
654 | 318 | +3 | ||
655 | 319 | +UPDATE t1 set a=4; | ||
656 | 320 | +SELECT * FROM t1; | ||
657 | 321 | +a | ||
658 | 322 | +4 | ||
659 | 323 | +4 | ||
660 | 324 | +4 | ||
661 | 325 | +DROP TABLE t1; | ||
662 | 326 | +SET GLOBAL innodb_kill_idle_transaction=0; | ||
663 | 327 | +SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction'; | ||
664 | 328 | +Variable_name Value | ||
665 | 329 | +innodb_kill_idle_transaction 0 | ||
666 | 330 | +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction'; | ||
667 | 331 | +VARIABLE_NAME VARIABLE_VALUE | ||
668 | 332 | +INNODB_KILL_IDLE_TRANSACTION 0 | ||
669 | 333 | --- /dev/null | ||
670 | 334 | +++ b/mysql-test/t/percona_innodb_kill_idle_trx.test | ||
671 | 335 | @@ -0,0 +1,28 @@ | ||
672 | 336 | +--source include/have_innodb.inc | ||
673 | 337 | +--disable_warnings | ||
674 | 338 | +DROP TABLE IF EXISTS t1; | ||
675 | 339 | +--enable_warnings | ||
676 | 340 | + | ||
677 | 341 | +SET autocommit=0; | ||
678 | 342 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
679 | 343 | + | ||
680 | 344 | +--source include/percona_innodb_kill_idle_trx_show.inc | ||
681 | 345 | +SET GLOBAL innodb_kill_idle_transaction=1; | ||
682 | 346 | +--source include/percona_innodb_kill_idle_trx_show.inc | ||
683 | 347 | + | ||
684 | 348 | +BEGIN; | ||
685 | 349 | +INSERT INTO t1 VALUES (1),(2),(3); | ||
686 | 350 | +COMMIT; | ||
687 | 351 | +SELECT * FROM t1; | ||
688 | 352 | + | ||
689 | 353 | +BEGIN; | ||
690 | 354 | +INSERT INTO t1 VALUES (4),(5),(6); | ||
691 | 355 | +sleep 3; | ||
692 | 356 | + | ||
693 | 357 | +--enable_reconnect | ||
694 | 358 | +--error 2006 --error CR_SERVER_GONE_ERROR | ||
695 | 359 | +SELECT * FROM t1; | ||
696 | 360 | +SELECT * FROM t1; | ||
697 | 361 | +DROP TABLE t1; | ||
698 | 362 | +SET GLOBAL innodb_kill_idle_transaction=0; | ||
699 | 363 | +--source include/percona_innodb_kill_idle_trx_show.inc | ||
700 | 364 | --- /dev/null | ||
701 | 365 | +++ b/mysql-test/t/percona_innodb_kill_idle_trx_locks.test | ||
702 | 366 | @@ -0,0 +1,31 @@ | ||
703 | 367 | +--source include/have_innodb.inc | ||
704 | 368 | +--disable_warnings | ||
705 | 369 | +DROP TABLE IF EXISTS t1; | ||
706 | 370 | +--enable_warnings | ||
707 | 371 | + | ||
708 | 372 | +SET autocommit=0; | ||
709 | 373 | +CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
710 | 374 | + | ||
711 | 375 | +--source include/percona_innodb_kill_idle_trx_show.inc | ||
712 | 376 | +SET GLOBAL innodb_kill_idle_transaction=5; | ||
713 | 377 | +--source include/percona_innodb_kill_idle_trx_show.inc | ||
714 | 378 | + | ||
715 | 379 | +connect (conn1,localhost,root,,); | ||
716 | 380 | +connection conn1; | ||
717 | 381 | + | ||
718 | 382 | +BEGIN; | ||
719 | 383 | +INSERT INTO t1 VALUES (1),(2),(3); | ||
720 | 384 | +COMMIT; | ||
721 | 385 | +SELECT * FROM t1; | ||
722 | 386 | + | ||
723 | 387 | +--echo ### Locking rows. Lock should be released when idle trx is killed. | ||
724 | 388 | +BEGIN; | ||
725 | 389 | +SELECT * FROM t1 FOR UPDATE; | ||
726 | 390 | + | ||
727 | 391 | +connection default; | ||
728 | 392 | +UPDATE t1 set a=4; | ||
729 | 393 | + | ||
730 | 394 | +SELECT * FROM t1; | ||
731 | 395 | +DROP TABLE t1; | ||
732 | 396 | +SET GLOBAL innodb_kill_idle_transaction=0; | ||
733 | 397 | +--source include/percona_innodb_kill_idle_trx_show.inc | ||
734 | 249 | 398 | ||
735 | === modified file 'patches/innodb_split_buf_pool_mutex.patch' | |||
736 | --- patches/innodb_split_buf_pool_mutex.patch 2011-08-09 13:35:34 +0000 | |||
737 | +++ patches/innodb_split_buf_pool_mutex.patch 2011-10-04 05:52:29 +0000 | |||
738 | @@ -1048,7 +1048,7 @@ | |||
739 | 1048 | ulint fix_type; | 1048 | ulint fix_type; |
740 | 1049 | ibool must_read; | 1049 | ibool must_read; |
741 | 1050 | ulint retries = 0; | 1050 | ulint retries = 0; |
743 | 1051 | + mutex_t* block_mutex; | 1051 | + mutex_t* block_mutex = NULL; |
744 | 1052 | 1052 | ||
745 | 1053 | ut_ad(mtr); | 1053 | ut_ad(mtr); |
746 | 1054 | ut_ad(mtr->state == MTR_ACTIVE); | 1054 | ut_ad(mtr->state == MTR_ACTIVE); |
747 | 1055 | 1055 | ||
748 | === modified file 'patches/series' | |||
749 | --- patches/series 2011-09-24 20:18:57 +0000 | |||
750 | +++ patches/series 2011-10-04 05:52:29 +0000 | |||
751 | @@ -34,6 +34,8 @@ | |||
752 | 34 | innodb_show_sys_tables.patch | 34 | innodb_show_sys_tables.patch |
753 | 35 | innodb_fix_misc.patch | 35 | innodb_fix_misc.patch |
754 | 36 | innodb_adjust_defaults.patch | 36 | innodb_adjust_defaults.patch |
755 | 37 | innodb_kill_idle_transaction.patch | ||
756 | 38 | innodb_fake_changes.patch | ||
757 | 37 | mysql-test.diff | 39 | mysql-test.diff |
758 | 38 | percona-support.patch | 40 | percona-support.patch |
759 | 39 | innodb_deadlock_count.patch | 41 | innodb_deadlock_count.patch |
http:// jenkins. percona. com/view/ Percona% 20Server% 205.1/job/ percona- server- 5.1-param/ 155/
(currently running, may not finish before I hop on the long-haul no-internet flight)