]>
Commit | Line | Data |
---|---|---|
89b96684 ER |
1 | diff -ruN a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c |
2 | --- a/innobase/buf/buf0flu.c 2009-08-04 16:53:42.000000000 +0900 | |
3 | +++ b/innobase/buf/buf0flu.c 2009-08-04 17:02:36.000000000 +0900 | |
4 | @@ -85,6 +85,22 @@ | |
5 | prev_b = NULL; | |
6 | b = UT_LIST_GET_FIRST(buf_pool->flush_list); | |
7 | ||
8 | + if (srv_fast_recovery) { | |
9 | + /* speed hack */ | |
10 | + if (b == NULL || (ut_dulint_cmp(b->oldest_modification, | |
11 | + block->oldest_modification) < 0)) { | |
12 | + UT_LIST_ADD_FIRST(flush_list, buf_pool->flush_list, block); | |
13 | + } else { | |
14 | + b = UT_LIST_GET_LAST(buf_pool->flush_list); | |
15 | + if (ut_dulint_cmp(b->oldest_modification, | |
16 | + block->oldest_modification) < 0) { | |
17 | + /* align oldest_modification not to sort */ | |
18 | + block->oldest_modification = b->oldest_modification; | |
19 | + } | |
20 | + UT_LIST_ADD_LAST(flush_list, buf_pool->flush_list, block); | |
21 | + } | |
22 | + } else { | |
23 | + /* normal */ | |
24 | while (b && (ut_dulint_cmp(b->oldest_modification, | |
25 | block->oldest_modification) > 0)) { | |
26 | prev_b = b; | |
27 | @@ -97,6 +113,7 @@ | |
28 | UT_LIST_INSERT_AFTER(flush_list, buf_pool->flush_list, prev_b, | |
29 | block); | |
30 | } | |
31 | + } | |
32 | ||
33 | ut_ad(buf_flush_validate_low()); | |
34 | } | |
35 | diff -ruN a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c | |
36 | --- a/innobase/buf/buf0rea.c 2009-08-04 16:53:42.000000000 +0900 | |
37 | +++ b/innobase/buf/buf0rea.c 2009-08-04 17:11:41.000000000 +0900 | |
38 | @@ -127,6 +127,46 @@ | |
39 | block = buf_page_init_for_read(err, mode, space, tablespace_version, | |
40 | offset); | |
41 | if (block == NULL) { | |
42 | + /* bugfix: http://bugs.mysql.com/bug.php?id=43948 */ | |
43 | + if (recv_recovery_is_on() && *err == DB_TABLESPACE_DELETED) { | |
44 | + /* hashed log recs must be treated here */ | |
45 | + recv_addr_t* recv_addr; | |
46 | + | |
47 | + mutex_enter(&(recv_sys->mutex)); | |
48 | + | |
49 | + if (recv_sys->apply_log_recs == FALSE) { | |
50 | + mutex_exit(&(recv_sys->mutex)); | |
51 | + goto not_to_recover; | |
52 | + } | |
53 | + | |
54 | + /* recv_get_fil_addr_struct() */ | |
55 | + recv_addr = HASH_GET_FIRST(recv_sys->addr_hash, | |
56 | + hash_calc_hash(ut_fold_ulint_pair(space, offset), | |
57 | + recv_sys->addr_hash)); | |
58 | + while (recv_addr) { | |
59 | + if ((recv_addr->space == space) | |
60 | + && (recv_addr->page_no == offset)) { | |
61 | + break; | |
62 | + } | |
63 | + recv_addr = HASH_GET_NEXT(addr_hash, recv_addr); | |
64 | + } | |
65 | + | |
66 | + if ((recv_addr == NULL) | |
67 | + || (recv_addr->state == RECV_BEING_PROCESSED) | |
68 | + || (recv_addr->state == RECV_PROCESSED)) { | |
69 | + mutex_exit(&(recv_sys->mutex)); | |
70 | + goto not_to_recover; | |
71 | + } | |
72 | + | |
73 | + fprintf(stderr, " (space:%lu is deleted)", space); | |
74 | + recv_addr->state = RECV_PROCESSED; | |
75 | + | |
76 | + ut_a(recv_sys->n_addrs); | |
77 | + recv_sys->n_addrs--; | |
78 | + | |
79 | + mutex_exit(&(recv_sys->mutex)); | |
80 | + } | |
81 | +not_to_recover: | |
82 | ||
83 | return(0); | |
84 | } | |
85 | @@ -697,11 +737,11 @@ | |
86 | while (buf_pool->n_pend_reads >= recv_n_pool_free_frames / 2) { | |
87 | ||
88 | os_aio_simulated_wake_handler_threads(); | |
89 | - os_thread_sleep(500000); | |
90 | + os_thread_sleep(10000); | |
91 | ||
92 | count++; | |
93 | ||
94 | - if (count > 100) { | |
95 | + if (count > 5000) { | |
96 | fprintf(stderr, | |
97 | "InnoDB: Error: InnoDB has waited for 50 seconds for pending\n" | |
98 | "InnoDB: reads to the buffer pool to be finished.\n" | |
99 | diff -ruN a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h | |
100 | --- a/innobase/include/srv0srv.h 2009-08-04 16:53:42.000000000 +0900 | |
101 | +++ b/innobase/include/srv0srv.h 2009-08-04 17:39:51.000000000 +0900 | |
102 | @@ -59,6 +59,8 @@ | |
103 | extern ibool srv_file_per_table; | |
104 | extern ibool srv_locks_unsafe_for_binlog; | |
105 | ||
106 | +extern ibool srv_fast_recovery; | |
107 | + | |
108 | extern ulint srv_n_data_files; | |
109 | extern char** srv_data_file_names; | |
110 | extern ulint* srv_data_file_sizes; | |
111 | diff -ruN a/innobase/log/log0recv.c b/innobase/log/log0recv.c | |
112 | --- a/innobase/log/log0recv.c 2009-07-07 21:54:08.000000000 +0900 | |
113 | +++ b/innobase/log/log0recv.c 2009-08-04 17:15:15.000000000 +0900 | |
114 | @@ -101,7 +101,7 @@ | |
115 | use these free frames to read in pages when we start applying the | |
116 | log records to the database. */ | |
117 | ||
118 | -ulint recv_n_pool_free_frames = 256; | |
119 | +ulint recv_n_pool_free_frames = 1024; | |
120 | ||
121 | /* The maximum lsn we see for a page during the recovery process. If this | |
122 | is bigger than the lsn we are able to scan up to, that is an indication that | |
123 | @@ -1135,6 +1135,8 @@ | |
124 | recv_addr = recv_get_fil_addr_struct(space, page_no); | |
125 | ||
126 | if ((recv_addr == NULL) | |
127 | + /* bugfix: http://bugs.mysql.com/bug.php?id=44140 */ | |
128 | + || (recv_addr->state == RECV_BEING_READ && !just_read_in) | |
129 | || (recv_addr->state == RECV_BEING_PROCESSED) | |
130 | || (recv_addr->state == RECV_PROCESSED)) { | |
131 | ||
132 | diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c | |
133 | --- a/innobase/srv/srv0srv.c 2009-08-04 16:53:42.000000000 +0900 | |
134 | +++ b/innobase/srv/srv0srv.c 2009-08-04 17:41:05.000000000 +0900 | |
135 | @@ -88,6 +88,8 @@ | |
136 | i.e. do not use next-key locking | |
137 | except on duplicate key checking and | |
138 | foreign key checking */ | |
139 | +ibool srv_fast_recovery = FALSE; | |
140 | + | |
141 | ulint srv_n_data_files = 0; | |
142 | char** srv_data_file_names = NULL; | |
143 | ulint* srv_data_file_sizes = NULL; /* size in database pages */ | |
144 | diff -ruN a/patch_info/innodb_recovery_patches.info b/patch_info/innodb_recovery_patches.info | |
145 | --- /dev/null 1970-01-01 09:00:00.000000000 +0900 | |
146 | +++ b/patch_info/innodb_recovery_patches.info 2009-08-04 16:58:07.000000000 +0900 | |
147 | @@ -0,0 +1,6 @@ | |
148 | +File=innodb_recovery_patches.patch | |
149 | +Name=Bugfixes and adjustments about recovery process | |
150 | +Version=1.0 | |
151 | +Author=Percona <info@percona.com> | |
152 | +License=GPL | |
153 | +Comment= | |
154 | diff -ruN a/sql/ha_innodb.cc b/sql/ha_innodb.cc | |
155 | --- a/sql/ha_innodb.cc 2009-08-04 16:53:42.000000000 +0900 | |
156 | +++ b/sql/ha_innodb.cc 2009-08-04 17:35:44.000000000 +0900 | |
157 | @@ -182,6 +182,7 @@ | |
158 | my_bool innobase_rollback_on_timeout = FALSE; | |
159 | my_bool innobase_create_status_file = FALSE; | |
160 | my_bool innobase_adaptive_hash_index = TRUE; | |
161 | +my_bool innobase_fast_recovery = FALSE; | |
162 | ||
163 | static char *internal_innobase_data_file_path = NULL; | |
164 | ||
165 | @@ -1534,6 +1535,8 @@ | |
166 | srv_lock_wait_timeout = (ulint) innobase_lock_wait_timeout; | |
167 | srv_force_recovery = (ulint) innobase_force_recovery; | |
168 | ||
169 | + srv_fast_recovery = (ibool) innobase_fast_recovery; | |
170 | + | |
171 | srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; | |
172 | srv_use_checksums = (ibool) innobase_use_checksums; | |
173 | ||
174 | diff -ruN a/sql/ha_innodb.h b/sql/ha_innodb.h | |
175 | --- a/sql/ha_innodb.h 2009-08-04 16:53:42.000000000 +0900 | |
176 | +++ b/sql/ha_innodb.h 2009-08-04 17:37:18.000000000 +0900 | |
177 | @@ -220,6 +220,7 @@ | |
178 | innobase_use_large_pages, | |
179 | innobase_use_native_aio, | |
180 | innobase_file_per_table, innobase_locks_unsafe_for_binlog, | |
181 | + innobase_fast_recovery, | |
182 | innobase_rollback_on_timeout, | |
183 | innobase_create_status_file, | |
184 | innobase_adaptive_hash_index; | |
185 | diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc | |
186 | --- a/sql/mysqld.cc 2009-08-04 16:53:42.000000000 +0900 | |
187 | +++ b/sql/mysqld.cc 2009-08-04 17:48:25.000000000 +0900 | |
188 | @@ -5102,6 +5102,7 @@ | |
189 | OPT_INNODB_READ_IO_THREADS, | |
190 | OPT_INNODB_WRITE_IO_THREADS, | |
191 | OPT_INNODB_USE_SYS_MALLOC, | |
192 | + OPT_INNODB_FAST_RECOVERY, | |
193 | OPT_INNODB_THREAD_CONCURRENCY_TIMER_BASED, | |
194 | OPT_INNODB_EXTRA_RSEGMENTS, | |
195 | OPT_INNODB_DICT_SIZE_LIMIT, | |
196 | @@ -5347,6 +5348,10 @@ | |
197 | {"innodb_doublewrite", OPT_INNODB_DOUBLEWRITE, "Enable InnoDB doublewrite buffer (enabled by default). \ | |
198 | Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, | |
199 | (gptr*) &innobase_use_doublewrite, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, | |
200 | + {"innodb_fast_recovery", OPT_INNODB_FAST_RECOVERY, | |
201 | + "Enable to use speed hack of recovery avoiding flush list sorting.", | |
202 | + (gptr*) &innobase_fast_recovery, (gptr*) &innobase_fast_recovery, | |
203 | + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, | |
204 | {"innodb_fast_shutdown", OPT_INNODB_FAST_SHUTDOWN, | |
205 | "Speeds up the shutdown process of the InnoDB storage engine. Possible " | |
206 | "values are 0, 1 (faster)" | |
207 | diff -ruN a/sql/set_var.cc b/sql/set_var.cc | |
208 | --- a/sql/set_var.cc 2009-08-04 16:53:42.000000000 +0900 | |
209 | +++ b/sql/set_var.cc 2009-08-04 17:51:49.000000000 +0900 | |
210 | @@ -1088,6 +1088,7 @@ | |
211 | {"innodb_read_io_threads", (char*) &innobase_read_io_threads, SHOW_LONG}, | |
212 | {"innodb_write_io_threads", (char*) &innobase_write_io_threads, SHOW_LONG}, | |
213 | {"innodb_use_sys_malloc", (char*) &innobase_use_sys_malloc, SHOW_MY_BOOL}, | |
214 | + {"innodb_fast_recovery", (char*) &innobase_fast_recovery, SHOW_MY_BOOL}, | |
215 | {"innodb_thread_concurrency_timer_based", (char*) &innobase_thread_concurrency_timer_based, SHOW_MY_BOOL}, | |
216 | {"innodb_extra_rsegments", (char*) &innobase_extra_rsegments, SHOW_LONG}, | |
217 | {sys_innodb_dict_size_limit.name, (char*) &sys_innodb_dict_size_limit, SHOW_SYS}, |