Merge lp:~percona-dev/percona-server/innodb-lru-auto-dump-restore into lp:percona-server/release-5.1.50-12

Proposed by Vadim Tkachenko
Status: Merged
Merged at revision: 124
Proposed branch: lp:~percona-dev/percona-server/innodb-lru-auto-dump-restore
Merge into: lp:percona-server/release-5.1.50-12
Diff against target: 376 lines (+264/-36)
1 file modified
innodb_lru_dump_restore.patch (+264/-36)
To merge this branch: bzr merge lp:~percona-dev/percona-server/innodb-lru-auto-dump-restore
Reviewer Review Type Date Requested Status
Yasufumi Kinoshita (community) Approve
Fred Linhoss (community) documentation Approve
Percona developers Pending
Review via email: mp+36642@code.launchpad.net

Description of the change

The implementation of automatic LRU dump / restore.

New variable added:

innodb_auto_lru_dump
* Time in seconds between automatic buffer pool dumps. 0 (the default) disables automatic dumps.

To post a comment you must log in.
Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

os_thread_create() seems to conflict with purge_threads.

n[] and thread_ids[] in srv0start.c should be extend, if you add new threads.

(not needed header changes)

review: Needs Fixing
Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

The thread should not be created the parameter is disabled

Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

It was fixed, please review again

> os_thread_create() seems to conflict with purge_threads.
>
> n[] and thread_ids[] in srv0start.c should be extend, if you add new threads.
>
> (not needed header changes)

Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

I decided to have thread created anyway, as parameter can be changed runtime.

> The thread should not be created the parameter is disabled

Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

Please don't break headers of diff and make keep clean to be reviewed easily, if you can.
The following changes are needed?

299 @@ -401,9 +493,9 @@
300
301 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
302 /**********************************************************************//**
303 -diff -ruN a/storage/innodb_plugin/include/buf0rea.h b/storage/innodb_plugin/include/buf0rea.h
304 ---- a/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:32:40.314021595 +0900
305 -+++ b/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:34:33.877059445 +0900
306 +diff -r 4f856ddb44ca storage/innodb_plugin/include/buf0rea.h
307 +--- a/storage/innodb_plugin/include/buf0rea.h Tue Sep 28 12:23:08 2010 -0700
308 ++++ b/storage/innodb_plugin/include/buf0rea.h Tue Sep 28 12:24:32 2010 -0700
309 @@ -31,6 +31,37 @@
310 #include "buf0types.h"
311

And,

218 @@ -239,10 +300,17 @@
219 ulint
220 buf_read_page_low(
221 /*==============*/
222 +<<<<<<< TREE
223 diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
224 --- a/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:32:40.298411400 +0900
225 +++ b/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:34:33.868058362 +0900
226 @@ -4869,6 +4869,78 @@
227 +=======
228 +diff -r 4f856ddb44ca storage/innodb_plugin/fil/fil0fil.c
229 +--- a/storage/innodb_plugin/fil/fil0fil.c Tue Sep 28 12:23:08 2010 -0700
230 ++++ b/storage/innodb_plugin/fil/fil0fil.c Tue Sep 28 12:24:32 2010 -0700
231 +@@ -4869,6 +4869,78 @@
232 +>>>>>>> MERGE-SOURCE
233 return(DB_SUCCESS);
234 }
235

Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

Yasufumi,

Header is unchanged is it ?

I am not sure where these diffs come from..
My patch is clean..

On Tue, Sep 28, 2010 at 5:54 PM, Yasufumi Kinoshita
<email address hidden> wrote:
> Please don't break headers of diff and make keep clean to be reviewed easily, if you can.
> The following changes are needed?
>
> 299     @@ -401,9 +493,9 @@
> 300
> 301     #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
> 302     /**********************************************************************//**
> 303     -diff -ruN a/storage/innodb_plugin/include/buf0rea.h b/storage/innodb_plugin/include/buf0rea.h
> 304     ---- a/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:32:40.314021595 +0900
> 305     -+++ b/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:34:33.877059445 +0900
> 306     +diff -r 4f856ddb44ca storage/innodb_plugin/include/buf0rea.h
> 307     +--- a/storage/innodb_plugin/include/buf0rea.h Tue Sep 28 12:23:08 2010 -0700
> 308     ++++ b/storage/innodb_plugin/include/buf0rea.h Tue Sep 28 12:24:32 2010 -0700
> 309     @@ -31,6 +31,37 @@
> 310     #include "buf0types.h"
> 311
>
> And,
>
> 218     @@ -239,10 +300,17 @@
> 219     ulint
> 220     buf_read_page_low(
> 221     /*==============*/
> 222     +<<<<<<< TREE
> 223     diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
> 224     --- a/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:32:40.298411400 +0900
> 225     +++ b/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:34:33.868058362 +0900
> 226     @@ -4869,6 +4869,78 @@
> 227     +=======
> 228     +diff -r 4f856ddb44ca storage/innodb_plugin/fil/fil0fil.c
> 229     +--- a/storage/innodb_plugin/fil/fil0fil.c Tue Sep 28 12:23:08 2010 -0700
> 230     ++++ b/storage/innodb_plugin/fil/fil0fil.c Tue Sep 28 12:24:32 2010 -0700
> 231     +@@ -4869,6 +4869,78 @@
> 232     +>>>>>>> MERGE-SOURCE
> 233     return(DB_SUCCESS);
> 234     }
> 235
> --
> https://code.launchpad.net/~percona-dev/percona-server/innodb-lru-auto-dump-restore/+merge/36642
> Your team Percona developers is requested to review the proposed merge of lp:~percona-dev/percona-server/innodb-lru-auto-dump-restore into lp:percona-server.
>

--
Vadim Tkachenko, CTO, Percona Inc.
Phone +1-888-401-3403,  Skype: vadimtk153
Schedule meeting: http://tungle.me/VadimTkachenko

Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

If don't need to be changed, don't change for clearness of the diff.
And the later case seems not to be solved the conflict.

Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

I will adjust the branch tomorrow.
Please re-review then.

Revision history for this message
Fred Linhoss (fred-linhoss) wrote :

Added system variable innodb_auto_lru_dump to [[percona_server:innodb_lru-auto_dump_restore]].

review: Approve (documentation)
Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'innodb_lru_dump_restore.patch'
--- innodb_lru_dump_restore.patch 2010-09-24 07:24:56 +0000
+++ innodb_lru_dump_restore.patch 2010-10-01 01:22:49 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c8diff -ruN a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c
9--- a/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:13:11.070058073 +09009--- a/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:13:11.070058073 +0900
10+++ b/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:34:33.860400549 +090010+++ b/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:34:33.860400549 +0900
11@@ -2122,6 +2122,218 @@11@@ -2122,6 +2122,278 @@
12 memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur);12 memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur);
13 }13 }
14 14
@@ -118,6 +118,26 @@
118+118+
119+ return(ret);119+ return(ret);
120+}120+}
121+
122+typedef struct {
123+ ib_uint32_t space_id;
124+ ib_uint32_t page_no;
125+} dump_record_t;
126+
127+static int dump_record_cmp(const void *a, const void *b)
128+{
129+ const dump_record_t *rec1 = (dump_record_t *) a;
130+ const dump_record_t *rec2 = (dump_record_t *) b;
131+
132+ if (rec1->space_id < rec2->space_id)
133+ return -1;
134+ if (rec1->space_id > rec2->space_id)
135+ return 1;
136+ if (rec1->page_no < rec2->page_no)
137+ return -1;
138+ return rec1->page_no > rec2->page_no;
139+}
140+
121+/********************************************************************//**141+/********************************************************************//**
122+Read the pages based on the specific file.*/142+Read the pages based on the specific file.*/
123+UNIV_INTERN143+UNIV_INTERN
@@ -135,25 +155,34 @@
135+ ulint req = 0;155+ ulint req = 0;
136+ ibool terminated = FALSE;156+ ibool terminated = FALSE;
137+ ibool ret = FALSE;157+ ibool ret = FALSE;
138+158+ dump_record_t* records;
139+ buffer_base = ut_malloc(2 * UNIV_PAGE_SIZE);159+ ulint size;
140+ buffer = ut_align(buffer_base, UNIV_PAGE_SIZE);160+ ulint size_high;
141+ if (!buffer) {161+ ulint length;
142+ fprintf(stderr,
143+ " InnoDB: cannot allocate buffer.\n");
144+ goto end;
145+ }
146+162+
147+ dump_file = os_file_create_simple_no_error_handling(163+ dump_file = os_file_create_simple_no_error_handling(
148+ LRU_DUMP_FILE, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);164+ LRU_DUMP_FILE, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);
149+ if (!success) {165+ if (!success || !os_file_get_size(dump_file, &size, &size_high)) {
150+ os_file_get_last_error(TRUE);166+ os_file_get_last_error(TRUE);
151+ fprintf(stderr,167+ fprintf(stderr,
152+ " InnoDB: cannot open %s\n", LRU_DUMP_FILE);168+ " InnoDB: cannot open %s\n", LRU_DUMP_FILE);
153+ goto end;169+ goto end;
154+ }170+ }
171+ if (size == 0 || size_high > 0 || size % 8) {
172+ fprintf(stderr, " InnoDB: broken LRU dump file\n");
173+ goto end;
174+ }
175+ buffer_base = ut_malloc(2 * UNIV_PAGE_SIZE);
176+ buffer = ut_align(buffer_base, UNIV_PAGE_SIZE);
177+ records = ut_malloc(size);
178+ if (!buffer || !records) {
179+ fprintf(stderr,
180+ " InnoDB: cannot allocate buffer.\n");
181+ goto end;
182+ }
155+183+
156+ buffers = 0;184+ buffers = 0;
185+ length = 0;
157+ while (!terminated) {186+ while (!terminated) {
158+ success = os_file_read(dump_file, buffer,187+ success = os_file_read(dump_file, buffer,
159+ (buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL,188+ (buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL,
@@ -162,15 +191,14 @@
162+ if (!success) {191+ if (!success) {
163+ fprintf(stderr,192+ fprintf(stderr,
164+ " InnoDB: cannot read page %lu of %s,"193+ " InnoDB: cannot read page %lu of %s,"
165+ " or meet unexpected terminal.",194+ " or meet unexpected terminal.\n",
166+ buffers, LRU_DUMP_FILE);195+ buffers, LRU_DUMP_FILE);
167+ goto end;196+ goto end;
168+ }197+ }
169+198+
170+ for (offset = 0; offset < UNIV_PAGE_SIZE/4; offset += 2) {199+ for (offset = 0; offset < UNIV_PAGE_SIZE/4; offset += 2) {
171+ ulint space_id, zip_size, page_no;200+ ulint space_id;
172+ ulint err;201+ ulint page_no;
173+ ib_int64_t tablespace_version;
174+202+
175+ space_id = mach_read_from_4(buffer + offset * 4);203+ space_id = mach_read_from_4(buffer + offset * 4);
176+ page_no = mach_read_from_4(buffer + (offset + 1) * 4);204+ page_no = mach_read_from_4(buffer + (offset + 1) * 4);
@@ -180,33 +208,63 @@
180+ break;208+ break;
181+ }209+ }
182+210+
183+ if (offset % 16 == 15) {211+ records[length].space_id = space_id;
184+ os_aio_simulated_wake_handler_threads();212+ records[length].page_no = page_no;
185+ buf_flush_free_margin(FALSE);213+ length++;
186+ }214+ if (length * 8 >= size) {
187+215+ fprintf(stderr,
188+ zip_size = fil_space_get_zip_size(space_id);216+ " InnoDB: could not find the "
189+ if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {217+ "end-of-file marker after reading "
190+ continue;218+ "the expected %lu bytes from the "
191+ }219+ "LRU dump file.\n"
192+220+ " InnoDB: this could be caused by a "
193+ if (fil_area_is_exist(space_id, zip_size, page_no, 0,221+ "broken or incomplete file.\n"
194+ zip_size ? zip_size : UNIV_PAGE_SIZE)) {222+ " InnoDB: trying to process what has "
195+223+ "been read so far.\n",
196+ tablespace_version = fil_space_get_version(space_id);224+ size);
197+225+ terminated= TRUE;
198+ req++;226+ break;
199+ reads += buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE
200+ | OS_AIO_SIMULATED_WAKE_LATER,
201+ space_id, zip_size, TRUE,
202+ tablespace_version, page_no, NULL);
203+ buf_LRU_stat_inc_io();
204+ }227+ }
205+ }228+ }
206+
207+ buffers++;229+ buffers++;
208+ }230+ }
209+231+
232+ qsort(records, length, sizeof(dump_record_t), dump_record_cmp);
233+
234+ for (offset = 0; offset < length; offset++) {
235+ ulint space_id;
236+ ulint page_no;
237+ ulint zip_size;
238+ ulint err;
239+ ib_int64_t tablespace_version;
240+
241+ space_id = records[offset].space_id;
242+ page_no = records[offset].page_no;
243+
244+ if (offset % 16 == 15) {
245+ os_aio_simulated_wake_handler_threads();
246+ buf_flush_free_margin(FALSE);
247+ }
248+
249+ zip_size = fil_space_get_zip_size(space_id);
250+ if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
251+ continue;
252+ }
253+
254+ if (fil_area_is_exist(space_id, zip_size, page_no, 0,
255+ zip_size ? zip_size : UNIV_PAGE_SIZE)) {
256+
257+ tablespace_version = fil_space_get_version(space_id);
258+
259+ req++;
260+ reads += buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE
261+ | OS_AIO_SIMULATED_WAKE_LATER,
262+ space_id, zip_size, TRUE,
263+ tablespace_version, page_no, NULL);
264+ buf_LRU_stat_inc_io();
265+ }
266+ }
267+
210+ os_aio_simulated_wake_handler_threads();268+ os_aio_simulated_wake_handler_threads();
211+ buf_flush_free_margin(FALSE);269+ buf_flush_free_margin(FALSE);
212+270+
@@ -220,6 +278,8 @@
220+ os_file_close(dump_file);278+ os_file_close(dump_file);
221+ if (buffer_base)279+ if (buffer_base)
222+ ut_free(buffer_base);280+ ut_free(buffer_base);
281+ if (records)
282+ ut_free(records);
223+283+
224+ return(ret);284+ return(ret);
225+}285+}
@@ -321,6 +381,30 @@
321 #ifndef UNIV_HOTBACKUP381 #ifndef UNIV_HOTBACKUP
322 /**********************************************************************//**382 /**********************************************************************//**
323 Waits for an aio operation to complete. This function is used to write the383 Waits for an aio operation to complete. This function is used to write the
384diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
385--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-10-01 09:57:56.486228425 +0900
386+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-10-01 10:00:13.292228546 +0900
387@@ -11431,6 +11431,12 @@
388 "Limit the allocated memory for dictionary cache. (0: unlimited)",
389 NULL, NULL, 0, 0, LONG_MAX, 0);
390
391+static MYSQL_SYSVAR_UINT(auto_lru_dump, srv_auto_lru_dump,
392+ PLUGIN_VAR_RQCMDARG,
393+ "Time in seconds between automatic buffer pool dumps. "
394+ "0 (the default) disables automatic dumps.",
395+ NULL, NULL, 0, 0, UINT_MAX32, 0);
396+
397 static struct st_mysql_sys_var* innobase_system_variables[]= {
398 MYSQL_SYSVAR(additional_mem_pool_size),
399 MYSQL_SYSVAR(autoextend_increment),
400@@ -11510,6 +11516,7 @@
401 MYSQL_SYSVAR(change_buffering),
402 MYSQL_SYSVAR(read_ahead_threshold),
403 MYSQL_SYSVAR(io_capacity),
404+ MYSQL_SYSVAR(auto_lru_dump),
405 MYSQL_SYSVAR(use_purge_thread),
406 NULL
407 };
324diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc408diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc
325--- a/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:29:12.540979608 +0900409--- a/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:29:12.540979608 +0900
326+++ b/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:34:33.873058189 +0900410+++ b/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:34:33.873058189 +0900
@@ -468,3 +552,147 @@
468 /**********************************************************************//**552 /**********************************************************************//**
469 Waits for an aio operation to complete. This function is used to write the553 Waits for an aio operation to complete. This function is used to write the
470 handler for completed requests. The aio array of pending requests is divided554 handler for completed requests. The aio array of pending requests is divided
555diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
556--- a/storage/innodb_plugin/include/srv0srv.h 2010-10-01 09:57:56.500228711 +0900
557+++ b/storage/innodb_plugin/include/srv0srv.h 2010-10-01 10:00:13.302223409 +0900
558@@ -334,6 +334,9 @@
559 reading of a disk page */
560 extern ulint srv_buf_pool_reads;
561
562+/** Time in seconds between automatic buffer pool dumps */
563+extern uint srv_auto_lru_dump;
564+
565 /** Status variables to be passed to MySQL */
566 typedef struct export_var_struct export_struc;
567
568@@ -602,6 +605,16 @@
569 /*=====================*/
570 void* arg); /*!< in: a dummy parameter required by
571 os_thread_create */
572+/*********************************************************************//**
573+A thread which restores the buffer pool from a dump file on startup and does
574+periodic buffer pool dumps.
575+@return a dummy parameter */
576+UNIV_INTERN
577+os_thread_ret_t
578+srv_LRU_dump_restore_thread(
579+/*====================*/
580+ void* arg); /*!< in: a dummy parameter required by
581+ os_thread_create */
582 /******************************************************************//**
583 Outputs to a file the output of the InnoDB Monitor.
584 @return FALSE if not all information printed
585diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
586--- a/storage/innodb_plugin/srv/srv0srv.c 2010-10-01 09:57:56.516255101 +0900
587+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-10-01 10:00:13.304230973 +0900
588@@ -298,6 +298,9 @@
589 reading of a disk page */
590 UNIV_INTERN ulint srv_buf_pool_reads = 0;
591
592+/** Time in seconds between automatic buffer pool dumps */
593+UNIV_INTERN uint srv_auto_lru_dump = 0;
594+
595 /* structure to pass status variables to MySQL */
596 UNIV_INTERN export_struc export_vars;
597
598@@ -2537,6 +2540,56 @@
599 /* We count the number of threads in os_thread_exit(). A created
600 thread should always use that to exit and not use return() to exit. */
601
602+ os_thread_exit(NULL);
603+
604+ OS_THREAD_DUMMY_RETURN;
605+}
606+
607+/*********************************************************************//**
608+A thread which restores the buffer pool from a dump file on startup and does
609+periodic buffer pool dumps.
610+@return a dummy parameter */
611+UNIV_INTERN
612+os_thread_ret_t
613+srv_LRU_dump_restore_thread(
614+/*====================*/
615+ void* arg __attribute__((unused)))
616+ /*!< in: a dummy parameter required by
617+ os_thread_create */
618+{
619+ uint auto_lru_dump;
620+ time_t last_dump_time;
621+ time_t time_elapsed;
622+
623+#ifdef UNIV_DEBUG_THREAD_CREATION
624+ fprintf(stderr, "LRU dump/restore thread starts, id %lu\n",
625+ os_thread_pf(os_thread_get_curr_id()));
626+#endif
627+
628+ if (srv_auto_lru_dump)
629+ buf_LRU_file_restore();
630+
631+ last_dump_time = time(NULL);
632+
633+loop:
634+ os_thread_sleep(5000000);
635+
636+ if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
637+ goto exit_func;
638+ }
639+
640+ time_elapsed = time(NULL) - last_dump_time;
641+ auto_lru_dump = srv_auto_lru_dump;
642+ if (auto_lru_dump > 0 && (time_t) auto_lru_dump < time_elapsed) {
643+ last_dump_time = time(NULL);
644+ buf_LRU_file_dump();
645+ }
646+
647+ goto loop;
648+exit_func:
649+ /* We count the number of threads in os_thread_exit(). A created
650+ thread should always use that to exit and not use return() to exit. */
651+
652 os_thread_exit(NULL);
653
654 OS_THREAD_DUMMY_RETURN;
655diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c
656--- a/storage/innodb_plugin/srv/srv0start.c 2010-10-01 09:57:56.420229366 +0900
657+++ b/storage/innodb_plugin/srv/srv0start.c 2010-10-01 10:00:13.309260428 +0900
658@@ -126,9 +126,9 @@
659 static ulint ios;
660
661 /** io_handler_thread parameters for thread identification */
662-static ulint n[SRV_MAX_N_IO_THREADS + 6 + 64];
663+static ulint n[SRV_MAX_N_IO_THREADS + 7 + 64];
664 /** io_handler_thread identifiers */
665-static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6 + 64];
666+static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 7 + 64];
667
668 /** We use this mutex to test the return value of pthread_mutex_trylock
669 on successful locking. HP-UX does NOT return 0, though Linux et al do. */
670@@ -1683,6 +1683,10 @@
671 os_thread_create(&srv_monitor_thread, NULL,
672 thread_ids + 4 + SRV_MAX_N_IO_THREADS);
673
674+ /* Create the thread which automaticaly dumps/restore buffer pool */
675+ os_thread_create(&srv_LRU_dump_restore_thread, NULL,
676+ thread_ids + 5 + SRV_MAX_N_IO_THREADS);
677+
678 srv_is_being_started = FALSE;
679
680 if (trx_doublewrite == NULL) {
681@@ -1707,13 +1711,13 @@
682 ulint i;
683
684 os_thread_create(&srv_purge_thread, NULL, thread_ids
685- + (5 + SRV_MAX_N_IO_THREADS));
686+ + (6 + SRV_MAX_N_IO_THREADS));
687
688 for (i = 0; i < srv_use_purge_thread - 1; i++) {
689- n[6 + i + SRV_MAX_N_IO_THREADS] = i; /* using as index for arrays in purge_sys */
690+ n[7 + i + SRV_MAX_N_IO_THREADS] = i; /* using as index for arrays in purge_sys */
691 os_thread_create(&srv_purge_worker_thread,
692- n + (6 + i + SRV_MAX_N_IO_THREADS),
693- thread_ids + (6 + i + SRV_MAX_N_IO_THREADS));
694+ n + (7 + i + SRV_MAX_N_IO_THREADS),
695+ thread_ids + (7 + i + SRV_MAX_N_IO_THREADS));
696 }
697 }
698 #ifdef UNIV_DEBUG

Subscribers

People subscribed via source and target branches

to all changes: