Merge lp:~percona-dev/percona-server/fb_changes_auto_lru_dump into lp:percona-server/release-5.1.54-12
- fb_changes_auto_lru_dump
- Merge into 5.1.54
Status: | Work in progress |
---|---|
Proposed branch: | lp:~percona-dev/percona-server/fb_changes_auto_lru_dump |
Merge into: | lp:percona-server/release-5.1.54-12 |
Diff against target: |
1684 lines (+481/-217) 16 files modified
innodb_adjust_defaults.patch (+4/-4) innodb_buffer_pool_shm.patch (+7/-7) innodb_deadlock_count.patch (+3/-3) innodb_fast_checksum.patch (+4/-4) innodb_fast_shutdown.patch (+15/-9) innodb_files_extend.patch (+4/-4) innodb_fix_misc.patch (+1/-1) innodb_lru_dump_restore.patch (+375/-114) innodb_pass_corrupt_table.patch (+27/-27) innodb_separate_doublewrite.patch (+3/-3) innodb_show_sys_tables.patch (+8/-11) profiling_slow.patch (+2/-2) response-time-distribution.patch (+1/-1) show_slave_status_nolock.patch (+2/-2) show_temp_51.patch (+2/-2) userstat.patch (+23/-23) |
To merge this branch: | bzr merge lp:~percona-dev/percona-server/fb_changes_auto_lru_dump |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vadim Tkachenko | Needs Fixing | ||
Fred Linhoss | documentation | Pending | |
Yasufumi Kinoshita | Pending | ||
Review via email: mp+46012@code.launchpad.net |
Commit message
Description of the change
- 190. By Alexey Kopytov
-
Merged Facebook's changes to innodb_
lru_dump_ restore. patch: LRU is dumped to a temporary file first to avoid partially written files
in backups or in case of a crash.Release the LRU mutex while doing memset and file IO. Should mimimize
the impact on the host during scheduled LRU dump. Basic detection of
LRU cycling should the next page to dump be put back at the head of the
LRU during the unlocked window.Added option innodb_
lru_dump_ old_pages to control whether old pages are
included in the LRU dump. The default is to only dump young pages.Added option innodb_
lru_load_ max_entries specifying the maximum number
of LRU entries to restore. The default is 512k entries (8GB).
Consecutive pages are merged and only count as one, so you will probably
load more pages than this number of LRU entries.Switched to writing out LRU in priority order.
Load in LRU priority order, but always merge consecutive pages.
Add status vars for LRU restore progress: lru_restore_
total_pages and
lru_restore_loaded_ pages. Added restore rate limiting (restore no more than innodb_io_capacity
pages per second). In my testing, a value of 5000 is fine for a
pre-up-ip warmup, but this should be reduced to 500 before serving
traffic to ensure adequate IO capacity is available for foreground
threads.
Vadim Tkachenko (vadim-tk) wrote : | # |
KAlexey, we had sorted pre-load in sequantual order, and it provided fast read from disks. I am not sure how fast is load in LRU order
KAlexey, we may want to have it as option which method to use
Alexey Kopytov (akopytov) wrote : | # |
I think loading in LRU order will be slower in most cases, even though this new approach tries to merge sequential records if they appear in the LRU-ordered list.
OK, will make that optional and resubmit.
Unmerged revisions
- 190. By Alexey Kopytov
-
Merged Facebook's changes to innodb_
lru_dump_ restore. patch: LRU is dumped to a temporary file first to avoid partially written files
in backups or in case of a crash.Release the LRU mutex while doing memset and file IO. Should mimimize
the impact on the host during scheduled LRU dump. Basic detection of
LRU cycling should the next page to dump be put back at the head of the
LRU during the unlocked window.Added option innodb_
lru_dump_ old_pages to control whether old pages are
included in the LRU dump. The default is to only dump young pages.Added option innodb_
lru_load_ max_entries specifying the maximum number
of LRU entries to restore. The default is 512k entries (8GB).
Consecutive pages are merged and only count as one, so you will probably
load more pages than this number of LRU entries.Switched to writing out LRU in priority order.
Load in LRU priority order, but always merge consecutive pages.
Add status vars for LRU restore progress: lru_restore_
total_pages and
lru_restore_loaded_ pages. Added restore rate limiting (restore no more than innodb_io_capacity
pages per second). In my testing, a value of 5000 is fine for a
pre-up-ip warmup, but this should be reduced to 500 before serving
traffic to ensure adequate IO capacity is available for foreground
threads.
Preview Diff
1 | === modified file 'innodb_adjust_defaults.patch' | |||
2 | --- innodb_adjust_defaults.patch 2010-12-16 11:35:26 +0000 | |||
3 | +++ innodb_adjust_defaults.patch 2011-01-12 17:48:16 +0000 | |||
4 | @@ -8,7 +8,7 @@ | |||
5 | 8 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc | 8 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc |
6 | 9 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:39:14.000000000 +0900 | 9 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:39:14.000000000 +0900 |
7 | 10 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:43:26.000000000 +0900 | 10 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:43:26.000000000 +0900 |
9 | 11 | @@ -11210,7 +11210,7 @@ | 11 | @@ -11214,7 +11214,7 @@ |
10 | 12 | static MYSQL_SYSVAR_ULONG(use_purge_thread, srv_use_purge_thread, | 12 | static MYSQL_SYSVAR_ULONG(use_purge_thread, srv_use_purge_thread, |
11 | 13 | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, | 13 | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, |
12 | 14 | "Number of purge devoted threads. #### over 1 is EXPERIMENTAL ####", | 14 | "Number of purge devoted threads. #### over 1 is EXPERIMENTAL ####", |
13 | @@ -17,7 +17,7 @@ | |||
14 | 17 | 17 | ||
15 | 18 | static MYSQL_SYSVAR_BOOL(overwrite_relay_log_info, innobase_overwrite_relay_log_info, | 18 | static MYSQL_SYSVAR_BOOL(overwrite_relay_log_info, innobase_overwrite_relay_log_info, |
16 | 19 | PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, | 19 | PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, |
18 | 20 | @@ -11310,7 +11310,7 @@ | 20 | @@ -11314,7 +11314,7 @@ |
19 | 21 | static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing, | 21 | static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing, |
20 | 22 | PLUGIN_VAR_NOCMDARG, | 22 | PLUGIN_VAR_NOCMDARG, |
21 | 23 | "Attempt flushing dirty pages to avoid IO bursts at checkpoints.", | 23 | "Attempt flushing dirty pages to avoid IO bursts at checkpoints.", |
22 | @@ -26,7 +26,7 @@ | |||
23 | 26 | 26 | ||
24 | 27 | static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag, | 27 | static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag, |
25 | 28 | PLUGIN_VAR_RQCMDARG, | 28 | PLUGIN_VAR_RQCMDARG, |
27 | 29 | @@ -11555,7 +11555,7 @@ | 29 | @@ -11559,7 +11559,7 @@ |
28 | 30 | static MYSQL_SYSVAR_ULONG(ibuf_active_contract, srv_ibuf_active_contract, | 30 | static MYSQL_SYSVAR_ULONG(ibuf_active_contract, srv_ibuf_active_contract, |
29 | 31 | PLUGIN_VAR_RQCMDARG, | 31 | PLUGIN_VAR_RQCMDARG, |
30 | 32 | "Enable/Disable active_contract of insert buffer. 0:disable 1:enable", | 32 | "Enable/Disable active_contract of insert buffer. 0:disable 1:enable", |
31 | @@ -35,7 +35,7 @@ | |||
32 | 35 | 35 | ||
33 | 36 | static MYSQL_SYSVAR_ULONG(ibuf_accel_rate, srv_ibuf_accel_rate, | 36 | static MYSQL_SYSVAR_ULONG(ibuf_accel_rate, srv_ibuf_accel_rate, |
34 | 37 | PLUGIN_VAR_RQCMDARG, | 37 | PLUGIN_VAR_RQCMDARG, |
36 | 38 | @@ -11635,8 +11635,8 @@ | 38 | @@ -11639,8 +11639,8 @@ |
37 | 39 | }; | 39 | }; |
38 | 40 | static MYSQL_SYSVAR_ENUM(adaptive_checkpoint, srv_adaptive_checkpoint, | 40 | static MYSQL_SYSVAR_ENUM(adaptive_checkpoint, srv_adaptive_checkpoint, |
39 | 41 | PLUGIN_VAR_RQCMDARG, | 41 | PLUGIN_VAR_RQCMDARG, |
40 | 42 | 42 | ||
41 | === modified file 'innodb_buffer_pool_shm.patch' | |||
42 | --- innodb_buffer_pool_shm.patch 2010-12-16 11:35:26 +0000 | |||
43 | +++ innodb_buffer_pool_shm.patch 2011-01-12 17:48:16 +0000 | |||
44 | @@ -675,7 +675,7 @@ | |||
45 | 675 | 675 | ||
46 | 676 | static char* internal_innobase_data_file_path = NULL; | 676 | static char* internal_innobase_data_file_path = NULL; |
47 | 677 | 677 | ||
49 | 678 | @@ -2457,6 +2458,7 @@ | 678 | @@ -2461,6 +2462,7 @@ |
50 | 679 | srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; | 679 | srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; |
51 | 680 | srv_use_checksums = (ibool) innobase_use_checksums; | 680 | srv_use_checksums = (ibool) innobase_use_checksums; |
52 | 681 | srv_fast_checksum = (ibool) innobase_fast_checksum; | 681 | srv_fast_checksum = (ibool) innobase_fast_checksum; |
53 | @@ -683,7 +683,7 @@ | |||
54 | 683 | 683 | ||
55 | 684 | #ifdef HAVE_LARGE_PAGES | 684 | #ifdef HAVE_LARGE_PAGES |
56 | 685 | if ((os_use_large_pages = (ibool) my_use_large_pages)) | 685 | if ((os_use_large_pages = (ibool) my_use_large_pages)) |
58 | 686 | @@ -11405,6 +11407,16 @@ | 686 | @@ -11409,6 +11411,16 @@ |
59 | 687 | "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", | 687 | "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", |
60 | 688 | NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L); | 688 | NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L); |
61 | 689 | 689 | ||
62 | @@ -700,7 +700,7 @@ | |||
63 | 700 | static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, | 700 | static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, |
64 | 701 | PLUGIN_VAR_RQCMDARG, | 701 | PLUGIN_VAR_RQCMDARG, |
65 | 702 | "Helps in performance tuning in heavily concurrent environments.", | 702 | "Helps in performance tuning in heavily concurrent environments.", |
67 | 703 | @@ -11680,6 +11692,8 @@ | 703 | @@ -11699,6 +11711,8 @@ |
68 | 704 | MYSQL_SYSVAR(additional_mem_pool_size), | 704 | MYSQL_SYSVAR(additional_mem_pool_size), |
69 | 705 | MYSQL_SYSVAR(autoextend_increment), | 705 | MYSQL_SYSVAR(autoextend_increment), |
70 | 706 | MYSQL_SYSVAR(buffer_pool_size), | 706 | MYSQL_SYSVAR(buffer_pool_size), |
71 | @@ -774,11 +774,10 @@ | |||
72 | 774 | #ifndef UNIV_HOTBACKUP | 774 | #ifndef UNIV_HOTBACKUP |
73 | 775 | /*************************************************************//** | 775 | /*************************************************************//** |
74 | 776 | Creates a mutex array to protect a hash table. */ | 776 | Creates a mutex array to protect a hash table. */ |
77 | 777 | @@ -327,6 +349,33 @@ | 777 | @@ -328,6 +350,33 @@ |
76 | 778 | }\ | ||
78 | 779 | }\ | 778 | }\ |
79 | 780 | } while (0) | 779 | } while (0) |
81 | 781 | + | 780 | |
82 | 782 | +/********************************************************************//** | 781 | +/********************************************************************//** |
83 | 783 | +Align nodes with moving location.*/ | 782 | +Align nodes with moving location.*/ |
84 | 784 | +#define HASH_OFFSET(TABLE, NODE_TYPE, PTR_NAME, FADDR, FOFFSET, BOFFSET) \ | 783 | +#define HASH_OFFSET(TABLE, NODE_TYPE, PTR_NAME, FADDR, FOFFSET, BOFFSET) \ |
85 | @@ -805,9 +804,10 @@ | |||
86 | 805 | + }\ | 804 | + }\ |
87 | 806 | + }\ | 805 | + }\ |
88 | 807 | +} while (0) | 806 | +} while (0) |
90 | 808 | 807 | + | |
91 | 809 | /************************************************************//** | 808 | /************************************************************//** |
92 | 810 | Gets the mutex index for a fold value in a hash table. | 809 | Gets the mutex index for a fold value in a hash table. |
93 | 810 | @return mutex number */ | ||
94 | 811 | diff -ruN a/storage/innodb_plugin/include/os0proc.h b/storage/innodb_plugin/include/os0proc.h | 811 | diff -ruN a/storage/innodb_plugin/include/os0proc.h b/storage/innodb_plugin/include/os0proc.h |
95 | 812 | --- a/storage/innodb_plugin/include/os0proc.h 2010-06-04 00:49:59.000000000 +0900 | 812 | --- a/storage/innodb_plugin/include/os0proc.h 2010-06-04 00:49:59.000000000 +0900 |
96 | 813 | +++ b/storage/innodb_plugin/include/os0proc.h 2010-07-14 16:40:16.169321536 +0900 | 813 | +++ b/storage/innodb_plugin/include/os0proc.h 2010-07-14 16:40:16.169321536 +0900 |
97 | 814 | 814 | ||
98 | === modified file 'innodb_deadlock_count.patch' | |||
99 | --- innodb_deadlock_count.patch 2010-12-13 11:43:12 +0000 | |||
100 | +++ innodb_deadlock_count.patch 2011-01-12 17:48:16 +0000 | |||
101 | @@ -31,7 +31,7 @@ | |||
102 | 31 | diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h | 31 | diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h |
103 | 32 | --- a/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.478241628 +0400 | 32 | --- a/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.478241628 +0400 |
104 | 33 | +++ b/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.936991959 +0400 | 33 | +++ b/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.936991959 +0400 |
106 | 34 | @@ -673,6 +673,7 @@ | 34 | @@ -687,6 +687,7 @@ |
107 | 35 | ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */ | 35 | ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */ |
108 | 36 | ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */ | 36 | ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */ |
109 | 37 | ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/ | 37 | ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/ |
110 | @@ -53,7 +53,7 @@ | |||
111 | 53 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c | 53 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c |
112 | 54 | --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.478241628 +0400 | 54 | --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.478241628 +0400 |
113 | 55 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.936991959 +0400 | 55 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.936991959 +0400 |
115 | 56 | @@ -438,7 +438,7 @@ | 56 | @@ -452,7 +452,7 @@ |
116 | 57 | static ulint srv_n_rows_updated_old = 0; | 57 | static ulint srv_n_rows_updated_old = 0; |
117 | 58 | static ulint srv_n_rows_deleted_old = 0; | 58 | static ulint srv_n_rows_deleted_old = 0; |
118 | 59 | static ulint srv_n_rows_read_old = 0; | 59 | static ulint srv_n_rows_read_old = 0; |
119 | @@ -62,7 +62,7 @@ | |||
120 | 62 | UNIV_INTERN ulint srv_n_lock_wait_count = 0; | 62 | UNIV_INTERN ulint srv_n_lock_wait_count = 0; |
121 | 63 | UNIV_INTERN ulint srv_n_lock_wait_current_count = 0; | 63 | UNIV_INTERN ulint srv_n_lock_wait_current_count = 0; |
122 | 64 | UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0; | 64 | UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0; |
124 | 65 | @@ -2149,6 +2149,8 @@ | 65 | @@ -2163,6 +2163,8 @@ |
125 | 66 | = UT_LIST_GET_LEN(buf_pool->flush_list); | 66 | = UT_LIST_GET_LEN(buf_pool->flush_list); |
126 | 67 | export_vars.innodb_buffer_pool_pages_free | 67 | export_vars.innodb_buffer_pool_pages_free |
127 | 68 | = UT_LIST_GET_LEN(buf_pool->free); | 68 | = UT_LIST_GET_LEN(buf_pool->free); |
128 | 69 | 69 | ||
129 | === modified file 'innodb_fast_checksum.patch' | |||
130 | --- innodb_fast_checksum.patch 2010-12-16 11:35:26 +0000 | |||
131 | +++ innodb_fast_checksum.patch 2011-01-12 17:48:16 +0000 | |||
132 | @@ -170,7 +170,7 @@ | |||
133 | 170 | static my_bool innobase_extra_undoslots = FALSE; | 170 | static my_bool innobase_extra_undoslots = FALSE; |
134 | 171 | static my_bool innobase_fast_recovery = FALSE; | 171 | static my_bool innobase_fast_recovery = FALSE; |
135 | 172 | static my_bool innobase_recovery_stats = TRUE; | 172 | static my_bool innobase_recovery_stats = TRUE; |
137 | 173 | @@ -2394,6 +2395,7 @@ | 173 | @@ -2398,6 +2399,7 @@ |
138 | 174 | 174 | ||
139 | 175 | srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; | 175 | srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; |
140 | 176 | srv_use_checksums = (ibool) innobase_use_checksums; | 176 | srv_use_checksums = (ibool) innobase_use_checksums; |
141 | @@ -178,7 +178,7 @@ | |||
142 | 178 | 178 | ||
143 | 179 | #ifdef HAVE_LARGE_PAGES | 179 | #ifdef HAVE_LARGE_PAGES |
144 | 180 | if ((os_use_large_pages = (ibool) my_use_large_pages)) | 180 | if ((os_use_large_pages = (ibool) my_use_large_pages)) |
146 | 181 | @@ -11105,6 +11107,15 @@ | 181 | @@ -11109,6 +11111,15 @@ |
147 | 182 | "Disable with --skip-innodb-checksums.", | 182 | "Disable with --skip-innodb-checksums.", |
148 | 183 | NULL, NULL, TRUE); | 183 | NULL, NULL, TRUE); |
149 | 184 | 184 | ||
150 | @@ -194,7 +194,7 @@ | |||
151 | 194 | static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir, | 194 | static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir, |
152 | 195 | PLUGIN_VAR_READONLY, | 195 | PLUGIN_VAR_READONLY, |
153 | 196 | "The common part for InnoDB table spaces.", | 196 | "The common part for InnoDB table spaces.", |
155 | 197 | @@ -11597,6 +11608,7 @@ | 197 | @@ -11616,6 +11627,7 @@ |
156 | 198 | MYSQL_SYSVAR(autoextend_increment), | 198 | MYSQL_SYSVAR(autoextend_increment), |
157 | 199 | MYSQL_SYSVAR(buffer_pool_size), | 199 | MYSQL_SYSVAR(buffer_pool_size), |
158 | 200 | MYSQL_SYSVAR(checksums), | 200 | MYSQL_SYSVAR(checksums), |
159 | @@ -301,7 +301,7 @@ | |||
160 | 301 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c | 301 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c |
161 | 302 | --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:40:36.599058304 +0900 | 302 | --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:40:36.599058304 +0900 |
162 | 303 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:42:03.647012289 +0900 | 303 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:42:03.647012289 +0900 |
164 | 304 | @@ -383,6 +383,7 @@ | 304 | @@ -397,6 +397,7 @@ |
165 | 305 | 305 | ||
166 | 306 | UNIV_INTERN ibool srv_use_doublewrite_buf = TRUE; | 306 | UNIV_INTERN ibool srv_use_doublewrite_buf = TRUE; |
167 | 307 | UNIV_INTERN ibool srv_use_checksums = TRUE; | 307 | UNIV_INTERN ibool srv_use_checksums = TRUE; |
168 | 308 | 308 | ||
169 | === modified file 'innodb_fast_shutdown.patch' | |||
170 | --- innodb_fast_shutdown.patch 2010-12-13 11:43:12 +0000 | |||
171 | +++ innodb_fast_shutdown.patch 2011-01-12 17:48:16 +0000 | |||
172 | @@ -11,6 +11,7 @@ | |||
173 | 11 | # suite. | 11 | # suite. |
174 | 12 | # | 12 | # |
175 | 13 | # The patch also implements os_event_wait_time() for POSIX systems. | 13 | # The patch also implements os_event_wait_time() for POSIX systems. |
176 | 14 | diff -ruN /dev/null b/COPYING.innodb_fast_shutdown | ||
177 | 14 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 15 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
178 | 15 | +++ b/COPYING.innodb_fast_shutdown 2010-11-16 21:37:51.000000000 +0300 | 16 | +++ b/COPYING.innodb_fast_shutdown 2010-11-16 21:37:51.000000000 +0300 |
179 | 16 | @@ -0,0 +1,10 @@ | 17 | @@ -0,0 +1,10 @@ |
180 | @@ -24,6 +25,7 @@ | |||
181 | 24 | + * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | 25 | + * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
182 | 25 | + | 26 | + |
183 | 26 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
184 | 28 | diff -ruN a/storage/innodb_plugin/include/os0sync.h b/storage/innodb_plugin/include/os0sync.h | ||
185 | 27 | --- a/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:33:00.000000000 +0300 | 29 | --- a/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:33:00.000000000 +0300 |
186 | 28 | +++ b/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:34:06.000000000 +0300 | 30 | +++ b/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:34:06.000000000 +0300 |
187 | 29 | @@ -189,14 +189,14 @@ | 31 | @@ -189,14 +189,14 @@ |
188 | @@ -43,6 +45,7 @@ | |||
189 | 43 | OS_SYNC_INFINITE_TIME */ | 45 | OS_SYNC_INFINITE_TIME */ |
190 | 44 | #ifdef __WIN__ | 46 | #ifdef __WIN__ |
191 | 45 | /**********************************************************//** | 47 | /**********************************************************//** |
192 | 48 | diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h | ||
193 | 46 | --- a/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:33:00.000000000 +0300 | 49 | --- a/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:33:00.000000000 +0300 |
194 | 47 | +++ b/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:34:06.000000000 +0300 | 50 | +++ b/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:34:06.000000000 +0300 |
195 | 48 | @@ -57,6 +57,9 @@ | 51 | @@ -57,6 +57,9 @@ |
196 | @@ -55,6 +58,7 @@ | |||
197 | 55 | /* If the last data file is auto-extended, we add this many pages to it | 58 | /* If the last data file is auto-extended, we add this many pages to it |
198 | 56 | at a time */ | 59 | at a time */ |
199 | 57 | #define SRV_AUTO_EXTEND_INCREMENT \ | 60 | #define SRV_AUTO_EXTEND_INCREMENT \ |
200 | 61 | diff -ruN a/storage/innodb_plugin/log/log0log.c b/storage/innodb_plugin/log/log0log.c | ||
201 | 58 | --- a/storage/innodb_plugin/log/log0log.c 2010-11-16 21:33:00.000000000 +0300 | 62 | --- a/storage/innodb_plugin/log/log0log.c 2010-11-16 21:33:00.000000000 +0300 |
202 | 59 | +++ b/storage/innodb_plugin/log/log0log.c 2010-11-16 21:34:06.000000000 +0300 | 63 | +++ b/storage/innodb_plugin/log/log0log.c 2010-11-16 21:34:06.000000000 +0300 |
203 | 60 | @@ -3103,6 +3103,7 @@ | 64 | @@ -3103,6 +3103,7 @@ |
204 | @@ -65,6 +69,7 @@ | |||
205 | 65 | loop: | 69 | loop: |
206 | 66 | os_thread_sleep(100000); | 70 | os_thread_sleep(100000); |
207 | 67 | 71 | ||
208 | 72 | diff -ruN a/storage/innodb_plugin/os/os0sync.c b/storage/innodb_plugin/os/os0sync.c | ||
209 | 68 | --- a/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:33:00.000000000 +0300 | 73 | --- a/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:33:00.000000000 +0300 |
210 | 69 | +++ b/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:34:06.000000000 +0300 | 74 | +++ b/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:34:06.000000000 +0300 |
211 | 70 | @@ -31,6 +31,9 @@ | 75 | @@ -31,6 +31,9 @@ |
212 | @@ -157,9 +162,10 @@ | |||
213 | 157 | #endif | 162 | #endif |
214 | 158 | } | 163 | } |
215 | 159 | 164 | ||
216 | 165 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c | ||
217 | 160 | --- a/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:33:00.000000000 +0300 | 166 | --- a/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:33:00.000000000 +0300 |
218 | 161 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:34:06.000000000 +0300 | 167 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:34:06.000000000 +0300 |
220 | 162 | @@ -707,6 +707,8 @@ | 168 | @@ -721,6 +721,8 @@ |
221 | 163 | 169 | ||
222 | 164 | UNIV_INTERN os_event_t srv_lock_timeout_thread_event; | 170 | UNIV_INTERN os_event_t srv_lock_timeout_thread_event; |
223 | 165 | 171 | ||
224 | @@ -168,7 +174,7 @@ | |||
225 | 168 | UNIV_INTERN srv_sys_t* srv_sys = NULL; | 174 | UNIV_INTERN srv_sys_t* srv_sys = NULL; |
226 | 169 | 175 | ||
227 | 170 | /* padding to prevent other memory update hotspots from residing on | 176 | /* padding to prevent other memory update hotspots from residing on |
229 | 171 | @@ -1012,6 +1014,7 @@ | 177 | @@ -1026,6 +1028,7 @@ |
230 | 172 | } | 178 | } |
231 | 173 | 179 | ||
232 | 174 | srv_lock_timeout_thread_event = os_event_create(NULL); | 180 | srv_lock_timeout_thread_event = os_event_create(NULL); |
233 | @@ -176,7 +182,7 @@ | |||
234 | 176 | 182 | ||
235 | 177 | for (i = 0; i < SRV_MASTER + 1; i++) { | 183 | for (i = 0; i < SRV_MASTER + 1; i++) { |
236 | 178 | srv_n_threads_active[i] = 0; | 184 | srv_n_threads_active[i] = 0; |
238 | 179 | @@ -2239,7 +2242,7 @@ | 185 | @@ -2257,7 +2260,7 @@ |
239 | 180 | /* Wake up every 5 seconds to see if we need to print | 186 | /* Wake up every 5 seconds to see if we need to print |
240 | 181 | monitor information. */ | 187 | monitor information. */ |
241 | 182 | 188 | ||
242 | @@ -185,7 +191,7 @@ | |||
243 | 185 | 191 | ||
244 | 186 | current_time = time(NULL); | 192 | current_time = time(NULL); |
245 | 187 | 193 | ||
247 | 188 | @@ -2381,7 +2384,7 @@ | 194 | @@ -2399,7 +2402,7 @@ |
248 | 189 | /* When someone is waiting for a lock, we wake up every second | 195 | /* When someone is waiting for a lock, we wake up every second |
249 | 190 | and check if a timeout has passed for a lock wait */ | 196 | and check if a timeout has passed for a lock wait */ |
250 | 191 | 197 | ||
251 | @@ -194,7 +200,7 @@ | |||
252 | 194 | 200 | ||
253 | 195 | srv_lock_timeout_active = TRUE; | 201 | srv_lock_timeout_active = TRUE; |
254 | 196 | 202 | ||
256 | 197 | @@ -2546,7 +2549,7 @@ | 203 | @@ -2564,7 +2567,7 @@ |
257 | 198 | 204 | ||
258 | 199 | fflush(stderr); | 205 | fflush(stderr); |
259 | 200 | 206 | ||
260 | @@ -203,16 +209,16 @@ | |||
261 | 203 | 209 | ||
262 | 204 | if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) { | 210 | if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) { |
263 | 205 | 211 | ||
265 | 206 | @@ -2590,7 +2593,7 @@ | 212 | @@ -2612,7 +2615,7 @@ |
266 | 207 | last_dump_time = time(NULL); | 213 | last_dump_time = time(NULL); |
267 | 208 | 214 | ||
268 | 209 | loop: | 215 | loop: |
270 | 210 | - os_thread_sleep(5000000); | 216 | - os_thread_sleep(1000000); |
271 | 211 | + os_event_wait_time(srv_shutdown_event, 5000000); | 217 | + os_event_wait_time(srv_shutdown_event, 5000000); |
272 | 212 | 218 | ||
273 | 213 | if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { | 219 | if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { |
274 | 214 | goto exit_func; | 220 | goto exit_func; |
276 | 215 | @@ -2770,7 +2773,7 @@ | 221 | @@ -2792,7 +2795,7 @@ |
277 | 216 | if (!skip_sleep) { | 222 | if (!skip_sleep) { |
278 | 217 | if (next_itr_time > cur_time) { | 223 | if (next_itr_time > cur_time) { |
279 | 218 | 224 | ||
280 | @@ -221,7 +227,7 @@ | |||
281 | 221 | srv_main_sleeps++; | 227 | srv_main_sleeps++; |
282 | 222 | 228 | ||
283 | 223 | /* | 229 | /* |
285 | 224 | @@ -3476,9 +3479,10 @@ | 230 | @@ -3498,9 +3501,10 @@ |
286 | 225 | mutex_exit(&kernel_mutex); | 231 | mutex_exit(&kernel_mutex); |
287 | 226 | 232 | ||
288 | 227 | sleep_ms = 10; | 233 | sleep_ms = 10; |
289 | 228 | 234 | ||
290 | === modified file 'innodb_files_extend.patch' | |||
291 | --- innodb_files_extend.patch 2010-12-16 11:35:26 +0000 | |||
292 | +++ innodb_files_extend.patch 2011-01-12 17:48:16 +0000 | |||
293 | @@ -89,7 +89,7 @@ | |||
294 | 89 | static my_bool innobase_thread_concurrency_timer_based; | 89 | static my_bool innobase_thread_concurrency_timer_based; |
295 | 90 | static long long innobase_buffer_pool_size, innobase_log_file_size; | 90 | static long long innobase_buffer_pool_size, innobase_log_file_size; |
296 | 91 | 91 | ||
298 | 92 | @@ -2084,6 +2087,62 @@ | 92 | @@ -2088,6 +2091,62 @@ |
299 | 93 | } | 93 | } |
300 | 94 | #endif /* UNIV_DEBUG */ | 94 | #endif /* UNIV_DEBUG */ |
301 | 95 | 95 | ||
302 | @@ -152,7 +152,7 @@ | |||
303 | 152 | #ifndef MYSQL_SERVER | 152 | #ifndef MYSQL_SERVER |
304 | 153 | innodb_overwrite_relay_log_info = FALSE; | 153 | innodb_overwrite_relay_log_info = FALSE; |
305 | 154 | #endif | 154 | #endif |
307 | 155 | @@ -7004,9 +7063,9 @@ | 155 | @@ -7008,9 +7067,9 @@ |
308 | 156 | | DICT_TF_COMPACT | 156 | | DICT_TF_COMPACT |
309 | 157 | | DICT_TF_FORMAT_ZIP | 157 | | DICT_TF_FORMAT_ZIP |
310 | 158 | << DICT_TF_FORMAT_SHIFT; | 158 | << DICT_TF_FORMAT_SHIFT; |
311 | @@ -165,7 +165,7 @@ | |||
312 | 165 | } | 165 | } |
313 | 166 | } | 166 | } |
314 | 167 | 167 | ||
316 | 168 | @@ -11116,6 +11175,16 @@ | 168 | @@ -11120,6 +11179,16 @@ |
317 | 169 | "#### Attention: The checksum is not compatible for normal or disabled version! ####", | 169 | "#### Attention: The checksum is not compatible for normal or disabled version! ####", |
318 | 170 | NULL, NULL, FALSE); | 170 | NULL, NULL, FALSE); |
319 | 171 | 171 | ||
320 | @@ -182,7 +182,7 @@ | |||
321 | 182 | static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir, | 182 | static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir, |
322 | 183 | PLUGIN_VAR_READONLY, | 183 | PLUGIN_VAR_READONLY, |
323 | 184 | "The common part for InnoDB table spaces.", | 184 | "The common part for InnoDB table spaces.", |
325 | 185 | @@ -11604,6 +11673,8 @@ | 185 | @@ -11623,6 +11692,8 @@ |
326 | 186 | NULL, NULL, 0, 0, 1, 0); | 186 | NULL, NULL, 0, 0, 1, 0); |
327 | 187 | 187 | ||
328 | 188 | static struct st_mysql_sys_var* innobase_system_variables[]= { | 188 | static struct st_mysql_sys_var* innobase_system_variables[]= { |
329 | 189 | 189 | ||
330 | === modified file 'innodb_fix_misc.patch' | |||
331 | --- innodb_fix_misc.patch 2010-12-20 21:54:44 +0000 | |||
332 | +++ innodb_fix_misc.patch 2011-01-12 17:48:16 +0000 | |||
333 | @@ -8,7 +8,7 @@ | |||
334 | 8 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc | 8 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc |
335 | 9 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:50:59.626327847 +0900 | 9 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:50:59.626327847 +0900 |
336 | 10 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:55:20.281021252 +0900 | 10 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:55:20.281021252 +0900 |
338 | 11 | @@ -11770,7 +11770,7 @@ | 11 | @@ -11791,7 +11791,7 @@ |
339 | 12 | &innobase_storage_engine, | 12 | &innobase_storage_engine, |
340 | 13 | innobase_hton_name, | 13 | innobase_hton_name, |
341 | 14 | "Innobase Oy", | 14 | "Innobase Oy", |
342 | 15 | 15 | ||
343 | === modified file 'innodb_lru_dump_restore.patch' | |||
344 | --- innodb_lru_dump_restore.patch 2010-12-22 18:24:52 +0000 | |||
345 | +++ innodb_lru_dump_restore.patch 2011-01-12 17:48:16 +0000 | |||
346 | @@ -5,50 +5,67 @@ | |||
347 | 5 | #!!! notice !!! | 5 | #!!! notice !!! |
348 | 6 | # Any small change to this file in the main branch | 6 | # Any small change to this file in the main branch |
349 | 7 | # should be done or reviewed by the maintainer! | 7 | # should be done or reviewed by the maintainer! |
350 | 8 | diff -ruN /dev/null b/mysql-test/suite/innodb_plugin/r/percona_bug692211.result | ||
351 | 8 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 9 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
353 | 9 | +++ b/mysql-test/suite/innodb_plugin/r/percona_bug692211.result 2010-12-22 20:48:19.000000000 +0300 | 10 | +++ b/mysql-test/suite/innodb_plugin/r/percona_bug692211.result 2011-01-12 19:38:48.000000000 +0300 |
354 | 10 | @@ -0,0 +1,7 @@ | 11 | @@ -0,0 +1,7 @@ |
355 | 11 | +# | 12 | +# |
357 | 12 | +# LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't | 13 | +# LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't |
358 | 13 | +# exist | 14 | +# exist |
359 | 14 | +# | 15 | +# |
360 | 15 | +SELECT @@innodb_auto_lru_dump; | 16 | +SELECT @@innodb_auto_lru_dump; |
361 | 16 | +@@innodb_auto_lru_dump | 17 | +@@innodb_auto_lru_dump |
362 | 17 | +300 | 18 | +300 |
363 | 19 | diff -ruN /dev/null b/mysql-test/suite/innodb_plugin/t/percona_bug692211-master.opt | ||
364 | 18 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 20 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
366 | 19 | +++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211-master.opt 2010-12-22 20:25:59.000000000 +0300 | 21 | +++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211-master.opt 2011-01-11 19:07:54.000000000 +0300 |
367 | 20 | @@ -0,0 +1 @@ | 22 | @@ -0,0 +1 @@ |
368 | 21 | +--innodb_auto_lru_dump=300 | 23 | +--innodb_auto_lru_dump=300 |
369 | 24 | diff -ruN /dev/null b/mysql-test/suite/innodb_plugin/t/percona_bug692211.test | ||
370 | 22 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 25 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
372 | 23 | +++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211.test 2010-12-22 20:17:57.000000000 +0300 | 26 | +++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211.test 2011-01-12 19:38:37.000000000 +0300 |
373 | 24 | @@ -0,0 +1,17 @@ | 27 | @@ -0,0 +1,17 @@ |
374 | 25 | +--source include/have_innodb_plugin.inc | 28 | +--source include/have_innodb_plugin.inc |
375 | 26 | + | 29 | + |
376 | 27 | +--echo # | 30 | +--echo # |
378 | 28 | +--echo # LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't | 31 | +--echo # LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't |
379 | 29 | +--echo # exist | 32 | +--echo # exist |
380 | 30 | +--echo # | 33 | +--echo # |
381 | 31 | + | 34 | + |
382 | 32 | +SELECT @@innodb_auto_lru_dump; | 35 | +SELECT @@innodb_auto_lru_dump; |
383 | 33 | + | 36 | + |
385 | 34 | +# We want to check that the server does not crash on startup when there is no | 37 | +# We want to check that the server does not crash on startup when there is no |
386 | 35 | +# ib_lru_dump in the datadir. If we are here, we have already started up | 38 | +# ib_lru_dump in the datadir. If we are here, we have already started up |
388 | 36 | +# successfully. So we only have to check that there is no ib_lru_dump in the | 39 | +# successfully. So we only have to check that there is no ib_lru_dump in the |
389 | 37 | +# datadir. | 40 | +# datadir. |
390 | 38 | + | 41 | + |
391 | 39 | +--let $MYSQLD_DATADIR= `SELECT @@datadir` | 42 | +--let $MYSQLD_DATADIR= `SELECT @@datadir` |
392 | 40 | +--error 1 | 43 | +--error 1 |
393 | 41 | +--file_exists $MYSQLD_DATADIR/ib_lru_dump; | 44 | +--file_exists $MYSQLD_DATADIR/ib_lru_dump; |
394 | 42 | diff -ruN a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c | 45 | diff -ruN a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c |
398 | 43 | --- a/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:13:11.070058073 +0900 | 46 | --- a/storage/innodb_plugin/buf/buf0lru.c 2011-01-11 19:07:52.000000000 +0300 |
399 | 44 | +++ b/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:34:33.860400549 +0900 | 47 | +++ b/storage/innodb_plugin/buf/buf0lru.c 2011-01-12 19:37:29.000000000 +0300 |
400 | 45 | @@ -2122,6 +2122,278 @@ | 48 | @@ -48,6 +48,7 @@ |
401 | 49 | #include "page0zip.h" | ||
402 | 50 | #include "log0recv.h" | ||
403 | 51 | #include "srv0srv.h" | ||
404 | 52 | +#include "srv0start.h" | ||
405 | 53 | |||
406 | 54 | /** The number of blocks from the LRU_old pointer onward, including | ||
407 | 55 | the block pointed to, must be buf_LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV | ||
408 | 56 | @@ -2122,6 +2123,445 @@ | ||
409 | 46 | memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur); | 57 | memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur); |
410 | 47 | } | 58 | } |
411 | 48 | 59 | ||
412 | 49 | +/********************************************************************//** | 60 | +/********************************************************************//** |
414 | 50 | +Dump the LRU page list to the specific file. */ | 61 | +Dump the LRU page list to the specific file. |
415 | 62 | + | ||
416 | 63 | +The format of the file is a list of (space id, page id) pairs, written in | ||
417 | 64 | +big-endian format, followed by the pair (0xFFFFFFFF, 0xFFFFFFFF). The order of | ||
418 | 65 | +the pages is the order in which they appear in the LRU, from most recent access | ||
419 | 66 | +to oldest access. */ | ||
420 | 51 | +#define LRU_DUMP_FILE "ib_lru_dump" | 67 | +#define LRU_DUMP_FILE "ib_lru_dump" |
421 | 68 | +#define LRU_DUMP_TEMP_FILE "ib_lru_dump.tmp" | ||
422 | 52 | + | 69 | + |
423 | 53 | +UNIV_INTERN | 70 | +UNIV_INTERN |
424 | 54 | +ibool | 71 | +ibool |
425 | @@ -60,10 +77,13 @@ | |||
426 | 60 | + byte* buffer_base = NULL; | 77 | + byte* buffer_base = NULL; |
427 | 61 | + byte* buffer = NULL; | 78 | + byte* buffer = NULL; |
428 | 62 | + buf_page_t* bpage; | 79 | + buf_page_t* bpage; |
429 | 80 | + buf_page_t* first_bpage; | ||
430 | 63 | + ulint buffers; | 81 | + ulint buffers; |
431 | 64 | + ulint offset; | 82 | + ulint offset; |
433 | 65 | + ibool ret = FALSE; | 83 | + ulint pages_written; |
434 | 66 | + ulint i; | 84 | + ulint i; |
435 | 85 | + ulint total_pages; | ||
436 | 86 | + mutex_t* next_block_mutex; | ||
437 | 67 | + | 87 | + |
438 | 68 | + for (i = 0; i < srv_n_data_files; i++) { | 88 | + for (i = 0; i < srv_n_data_files; i++) { |
439 | 69 | + if (strstr(srv_data_file_names[i], LRU_DUMP_FILE) != NULL) { | 89 | + if (strstr(srv_data_file_names[i], LRU_DUMP_FILE) != NULL) { |
440 | @@ -83,8 +103,8 @@ | |||
441 | 83 | + goto end; | 103 | + goto end; |
442 | 84 | + } | 104 | + } |
443 | 85 | + | 105 | + |
446 | 86 | + dump_file = os_file_create(LRU_DUMP_FILE, OS_FILE_OVERWRITE, | 106 | + dump_file = os_file_create(LRU_DUMP_TEMP_FILE, OS_FILE_OVERWRITE, |
447 | 87 | + OS_FILE_NORMAL, OS_DATA_FILE, &success); | 107 | + OS_FILE_NORMAL, OS_DATA_FILE, &success); |
448 | 88 | + if (!success) { | 108 | + if (!success) { |
449 | 89 | + os_file_get_last_error(TRUE); | 109 | + os_file_get_last_error(TRUE); |
450 | 90 | + fprintf(stderr, | 110 | + fprintf(stderr, |
451 | @@ -92,13 +112,27 @@ | |||
452 | 92 | + goto end; | 112 | + goto end; |
453 | 93 | + } | 113 | + } |
454 | 94 | + | 114 | + |
455 | 115 | + memset(buffer, 0, UNIV_PAGE_SIZE); | ||
456 | 116 | + | ||
457 | 117 | + /* walk the buffer pool from most recent to oldest */ | ||
458 | 95 | + mutex_enter(&LRU_list_mutex); | 118 | + mutex_enter(&LRU_list_mutex); |
465 | 96 | + bpage = UT_LIST_GET_LAST(buf_pool->LRU); | 119 | + bpage = first_bpage = UT_LIST_GET_FIRST(buf_pool->LRU); |
466 | 97 | + | 120 | + total_pages = UT_LIST_GET_LEN(buf_pool->LRU); |
467 | 98 | + buffers = offset = 0; | 121 | + |
468 | 99 | + while (bpage != NULL) { | 122 | + buffers = offset = pages_written = 0; |
469 | 100 | + if (offset == 0) { | 123 | + while (bpage != NULL && |
470 | 101 | + memset(buffer, 0, UNIV_PAGE_SIZE); | 124 | + (srv_lru_dump_old_pages || !buf_page_is_old(bpage)) && |
471 | 125 | + (pages_written++ < total_pages)) { | ||
472 | 126 | + | ||
473 | 127 | + buf_page_t* next_bpage = UT_LIST_GET_NEXT(LRU, bpage); | ||
474 | 128 | + | ||
475 | 129 | + if (next_bpage == first_bpage) { | ||
476 | 130 | + buf_pool_mutex_exit(); | ||
477 | 131 | + fprintf(stderr, | ||
478 | 132 | + " InnoDB: detected cycle in LRU, skipping " | ||
479 | 133 | + "dump\n"); | ||
480 | 134 | + success = FALSE; | ||
481 | 135 | + goto end; | ||
482 | 102 | + } | 136 | + } |
483 | 103 | + | 137 | + |
484 | 104 | + mach_write_to_4(buffer + offset * 4, bpage->space); | 138 | + mach_write_to_4(buffer + offset * 4, bpage->space); |
485 | @@ -106,51 +140,84 @@ | |||
486 | 106 | + mach_write_to_4(buffer + offset * 4, bpage->offset); | 140 | + mach_write_to_4(buffer + offset * 4, bpage->offset); |
487 | 107 | + offset++; | 141 | + offset++; |
488 | 108 | + | 142 | + |
493 | 109 | + if (offset == UNIV_PAGE_SIZE/4) { | 143 | + /* write out one page of data at a time */ |
494 | 110 | + success = os_file_write(LRU_DUMP_FILE, dump_file, buffer, | 144 | + if (offset < UNIV_PAGE_SIZE / 4) { |
495 | 111 | + (buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL, | 145 | + bpage = next_bpage; |
496 | 112 | + (buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)), | 146 | + continue; |
497 | 147 | + } | ||
498 | 148 | + | ||
499 | 149 | + /* while writing file, release buffer pool mutex but | ||
500 | 150 | + keep the next page fixed so we don't worry about | ||
501 | 151 | + our list iterator becoming invalid */ | ||
502 | 152 | + if (next_bpage) { | ||
503 | 153 | + next_block_mutex = buf_page_get_mutex(next_bpage); | ||
504 | 154 | + | ||
505 | 155 | + mutex_enter(next_block_mutex); | ||
506 | 156 | + next_bpage->buf_fix_count++; | ||
507 | 157 | + mutex_exit(next_block_mutex); | ||
508 | 158 | + } | ||
509 | 159 | + mutex_exit(&LRU_list_mutex); | ||
510 | 160 | + | ||
511 | 161 | + success = os_file_write(LRU_DUMP_TEMP_FILE, dump_file, | ||
512 | 162 | + buffer, | ||
513 | 163 | + (buffers << UNIV_PAGE_SIZE_SHIFT) & | ||
514 | 164 | + 0xFFFFFFFFUL, | ||
515 | 165 | + (buffers >> | ||
516 | 166 | + (32 - UNIV_PAGE_SIZE_SHIFT)), | ||
517 | 113 | + UNIV_PAGE_SIZE); | 167 | + UNIV_PAGE_SIZE); |
530 | 114 | + if (!success) { | 168 | + memset(buffer, 0, UNIV_PAGE_SIZE); |
531 | 115 | + mutex_exit(&LRU_list_mutex); | 169 | + |
532 | 116 | + fprintf(stderr, | 170 | + buf_pool_mutex_enter(); |
533 | 117 | + " InnoDB: cannot write page %lu of %s\n", | 171 | + if (next_bpage) { |
534 | 118 | + buffers, LRU_DUMP_FILE); | 172 | + mutex_enter(next_block_mutex); |
535 | 119 | + goto end; | 173 | + next_bpage->buf_fix_count--; |
536 | 120 | + } | 174 | + mutex_exit(next_block_mutex); |
537 | 121 | + buffers++; | 175 | + } |
538 | 122 | + offset = 0; | 176 | + if (!success) { |
539 | 123 | + } | 177 | + mutex_exit(&LRU_list_mutex); |
540 | 124 | + | 178 | + fprintf(stderr, |
541 | 125 | + bpage = UT_LIST_GET_PREV(LRU, bpage); | 179 | + " InnoDB: cannot write page %lu of %s\n", |
542 | 180 | + buffers, LRU_DUMP_TEMP_FILE); | ||
543 | 181 | + goto end; | ||
544 | 182 | + } | ||
545 | 183 | + buffers++; | ||
546 | 184 | + offset = 0; | ||
547 | 185 | + | ||
548 | 186 | + bpage = next_bpage; | ||
549 | 126 | + } | 187 | + } |
550 | 127 | + mutex_exit(&LRU_list_mutex); | 188 | + mutex_exit(&LRU_list_mutex); |
551 | 128 | + | 189 | + |
565 | 129 | + if (offset == 0) { | 190 | + /* mark end of file with 0xFFFFFFFF */ |
566 | 130 | + memset(buffer, 0, UNIV_PAGE_SIZE); | 191 | + mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL); |
567 | 131 | + } | 192 | + offset++; |
568 | 132 | + | 193 | + mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL); |
569 | 133 | + mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL); | 194 | + offset++; |
570 | 134 | + offset++; | 195 | + |
571 | 135 | + mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL); | 196 | + success = os_file_write(LRU_DUMP_TEMP_FILE, dump_file, buffer, |
572 | 136 | + offset++; | 197 | + (buffers << UNIV_PAGE_SIZE_SHIFT) & |
573 | 137 | + | 198 | + 0xFFFFFFFFUL, |
574 | 138 | + success = os_file_write(LRU_DUMP_FILE, dump_file, buffer, | 199 | + (buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)), |
575 | 139 | + (buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL, | 200 | + UNIV_PAGE_SIZE); |
563 | 140 | + (buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)), | ||
564 | 141 | + UNIV_PAGE_SIZE); | ||
576 | 142 | + if (!success) { | 201 | + if (!success) { |
577 | 143 | + goto end; | 202 | + goto end; |
578 | 144 | + } | 203 | + } |
579 | 145 | + | 204 | + |
580 | 146 | + ret = TRUE; | ||
581 | 147 | +end: | 205 | +end: |
583 | 148 | + if (dump_file != -1) | 206 | + if (dump_file != -1) { |
584 | 207 | + if (success) { | ||
585 | 208 | + success = os_file_flush(dump_file); | ||
586 | 209 | + } | ||
587 | 149 | + os_file_close(dump_file); | 210 | + os_file_close(dump_file); |
589 | 150 | + if (buffer_base) | 211 | + } |
590 | 212 | + if (success) { | ||
591 | 213 | + success = os_file_rename(LRU_DUMP_TEMP_FILE, | ||
592 | 214 | + LRU_DUMP_FILE); | ||
593 | 215 | + } | ||
594 | 216 | + if (buffer_base) { | ||
595 | 151 | + ut_free(buffer_base); | 217 | + ut_free(buffer_base); |
596 | 218 | + } | ||
597 | 152 | + | 219 | + |
599 | 153 | + return(ret); | 220 | + return(success); |
600 | 154 | +} | 221 | +} |
601 | 155 | + | 222 | + |
602 | 156 | +typedef struct { | 223 | +typedef struct { |
603 | @@ -173,7 +240,16 @@ | |||
604 | 173 | +} | 240 | +} |
605 | 174 | + | 241 | + |
606 | 175 | +/********************************************************************//** | 242 | +/********************************************************************//** |
608 | 176 | +Read the pages based on the specific file.*/ | 243 | +Read the pages based on the specific file. |
609 | 244 | + | ||
610 | 245 | +Pre-warms the buffer pool by loading the buffer pool pages recorded in | ||
611 | 246 | +LRU_DUMP_FILE by automatic or manual invocation of buf_LRU_file_dump. | ||
612 | 247 | + | ||
613 | 248 | +The pages are loaded in LRU priority order to ensure the most frequently | ||
614 | 249 | +accessed pages are loaded first. While loading in LRU priority order, any | ||
615 | 250 | +lower priority pages that are logically adjacent to higher priority pages are | ||
616 | 251 | +loaded along with the higher priority page. The goal is to maximize the size | ||
617 | 252 | +of the data reads without introducing many additional seeks.*/ | ||
618 | 177 | +UNIV_INTERN | 253 | +UNIV_INTERN |
619 | 178 | +ibool | 254 | +ibool |
620 | 179 | +buf_LRU_file_restore(void) | 255 | +buf_LRU_file_restore(void) |
621 | @@ -190,9 +266,17 @@ | |||
622 | 190 | + ibool terminated = FALSE; | 266 | + ibool terminated = FALSE; |
623 | 191 | + ibool ret = FALSE; | 267 | + ibool ret = FALSE; |
624 | 192 | + dump_record_t* records = NULL; | 268 | + dump_record_t* records = NULL; |
625 | 269 | + dump_record_t* sorted_records = NULL; | ||
626 | 270 | + dump_record_t* current_record; | ||
627 | 271 | + dump_record_t* prev_record; | ||
628 | 272 | + dump_record_t* next_record; | ||
629 | 273 | + unsigned char* records_loaded = NULL; | ||
630 | 193 | + ulint size; | 274 | + ulint size; |
631 | 194 | + ulint size_high; | 275 | + ulint size_high; |
632 | 195 | + ulint length; | 276 | + ulint length; |
633 | 277 | + ulint nrecs; | ||
634 | 278 | + ulint recsize = sizeof(dump_record_t); | ||
635 | 279 | + ullint loop_timer; | ||
636 | 196 | + | 280 | + |
637 | 197 | + dump_file = os_file_create_simple_no_error_handling( | 281 | + dump_file = os_file_create_simple_no_error_handling( |
638 | 198 | + LRU_DUMP_FILE, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success); | 282 | + LRU_DUMP_FILE, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success); |
639 | @@ -202,16 +286,20 @@ | |||
640 | 202 | + " InnoDB: cannot open %s\n", LRU_DUMP_FILE); | 286 | + " InnoDB: cannot open %s\n", LRU_DUMP_FILE); |
641 | 203 | + goto end; | 287 | + goto end; |
642 | 204 | + } | 288 | + } |
644 | 205 | + if (size == 0 || size_high > 0 || size % 8) { | 289 | + if (size == 0 || size_high > 0 || size % recsize) { |
645 | 206 | + fprintf(stderr, " InnoDB: broken LRU dump file\n"); | 290 | + fprintf(stderr, " InnoDB: broken LRU dump file\n"); |
646 | 207 | + goto end; | 291 | + goto end; |
647 | 208 | + } | 292 | + } |
648 | 209 | + buffer_base = ut_malloc(2 * UNIV_PAGE_SIZE); | 293 | + buffer_base = ut_malloc(2 * UNIV_PAGE_SIZE); |
649 | 210 | + buffer = ut_align(buffer_base, UNIV_PAGE_SIZE); | 294 | + buffer = ut_align(buffer_base, UNIV_PAGE_SIZE); |
652 | 211 | + records = ut_malloc(size); | 295 | + |
653 | 212 | + if (!buffer || !records) { | 296 | + nrecs = size / recsize; |
654 | 297 | + records = ut_malloc(nrecs * recsize); | ||
655 | 298 | + sorted_records = ut_malloc(nrecs * recsize); | ||
656 | 299 | + records_loaded = ut_malloc(nrecs * sizeof(unsigned char)); | ||
657 | 300 | + if (!buffer || !records || !sorted_records || !records_loaded) { | ||
658 | 213 | + fprintf(stderr, | 301 | + fprintf(stderr, |
660 | 214 | + " InnoDB: cannot allocate buffer.\n"); | 302 | + " InnoDB: cannot allocate buffer(s).\n"); |
661 | 215 | + goto end; | 303 | + goto end; |
662 | 216 | + } | 304 | + } |
663 | 217 | + | 305 | + |
664 | @@ -236,6 +324,7 @@ | |||
665 | 236 | + | 324 | + |
666 | 237 | + space_id = mach_read_from_4(buffer + offset * 4); | 325 | + space_id = mach_read_from_4(buffer + offset * 4); |
667 | 238 | + page_no = mach_read_from_4(buffer + (offset + 1) * 4); | 326 | + page_no = mach_read_from_4(buffer + (offset + 1) * 4); |
668 | 327 | + /* found list terminator value 0xFFFFFFFF */ | ||
669 | 239 | + if (space_id == 0xFFFFFFFFUL | 328 | + if (space_id == 0xFFFFFFFFUL |
670 | 240 | + || page_no == 0xFFFFFFFFUL) { | 329 | + || page_no == 0xFFFFFFFFUL) { |
671 | 241 | + terminated = TRUE; | 330 | + terminated = TRUE; |
672 | @@ -263,9 +352,26 @@ | |||
673 | 263 | + buffers++; | 352 | + buffers++; |
674 | 264 | + } | 353 | + } |
675 | 265 | + | 354 | + |
679 | 266 | + qsort(records, length, sizeof(dump_record_t), dump_record_cmp); | 355 | + srv_lru_restore_total_pages = length; |
680 | 267 | + | 356 | + srv_lru_restore_loaded_pages = 0; |
681 | 268 | + for (offset = 0; offset < length; offset++) { | 357 | + |
682 | 358 | + /* Copy the records into a second array and sort them, this will | ||
683 | 359 | + allow us to identify sequential records so we can load contiguous | ||
684 | 360 | + data while still prioritizing based on LRU order in the original */ | ||
685 | 361 | + memcpy(sorted_records, records, length * recsize); | ||
686 | 362 | + qsort(sorted_records, length, recsize, dump_record_cmp); | ||
687 | 363 | + | ||
688 | 364 | + /* As we will be loading data in a new order, we use this array to | ||
689 | 365 | + track which records have already been loaded */ | ||
690 | 366 | + memset(records_loaded, 0, length * sizeof(unsigned char)); | ||
691 | 367 | + | ||
692 | 368 | + /* start time */ | ||
693 | 369 | + loop_timer= ut_time_us(NULL); | ||
694 | 370 | + | ||
695 | 371 | + /* iterate over the LRU in priority order */ | ||
696 | 372 | + for (offset = 0; | ||
697 | 373 | + offset < ut_min(length, srv_lru_load_max_entries); | ||
698 | 374 | + offset++) { | ||
699 | 269 | + ulint space_id; | 375 | + ulint space_id; |
700 | 270 | + ulint page_no; | 376 | + ulint page_no; |
701 | 271 | + ulint zip_size; | 377 | + ulint zip_size; |
702 | @@ -273,29 +379,97 @@ | |||
703 | 273 | + ib_int64_t tablespace_version; | 379 | + ib_int64_t tablespace_version; |
704 | 274 | + | 380 | + |
705 | 275 | + space_id = records[offset].space_id; | 381 | + space_id = records[offset].space_id; |
706 | 276 | + page_no = records[offset].page_no; | ||
707 | 277 | + | ||
708 | 278 | + if (offset % 16 == 15) { | ||
709 | 279 | + os_aio_simulated_wake_handler_threads(); | ||
710 | 280 | + buf_flush_free_margin(FALSE); | ||
711 | 281 | + } | ||
712 | 282 | + | ||
713 | 283 | + zip_size = fil_space_get_zip_size(space_id); | 382 | + zip_size = fil_space_get_zip_size(space_id); |
714 | 284 | + if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) { | 383 | + if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) { |
715 | 285 | + continue; | 384 | + continue; |
716 | 286 | + } | 385 | + } |
717 | 287 | + | 386 | + |
720 | 288 | + if (fil_area_is_exist(space_id, zip_size, page_no, 0, | 387 | + /* we iterate over the LRU in priority order, but want to find |
721 | 289 | + zip_size ? zip_size : UNIV_PAGE_SIZE)) { | 388 | + the record's position in the sorted array so we can look for |
722 | 389 | + consecutive runs */ | ||
723 | 390 | + current_record = bsearch(records + offset, sorted_records, | ||
724 | 391 | + length, sizeof(dump_record_t), | ||
725 | 392 | + dump_record_cmp); | ||
726 | 393 | + ut_ad(current_record); | ||
727 | 394 | + | ||
728 | 395 | + /* check if we already loaded this record as part of another | ||
729 | 396 | + consecutive run */ | ||
730 | 397 | + if (records_loaded[current_record - sorted_records]) { | ||
731 | 398 | + continue; | ||
732 | 399 | + } | ||
733 | 400 | + | ||
734 | 401 | + /* step backwards in the sorted array until we find the start | ||
735 | 402 | + of this run of consecutive pages */ | ||
736 | 403 | + while (current_record > sorted_records) { | ||
737 | 404 | + prev_record = current_record - 1; | ||
738 | 405 | + | ||
739 | 406 | + if (prev_record->space_id != current_record->space_id || | ||
740 | 407 | + prev_record->page_no + 1 != | ||
741 | 408 | + current_record->page_no) { | ||
742 | 409 | + break; | ||
743 | 410 | + } | ||
744 | 411 | + | ||
745 | 412 | + current_record = prev_record; | ||
746 | 413 | + } | ||
747 | 414 | + | ||
748 | 415 | + /* now step forwards requesting consecutive pages */ | ||
749 | 416 | + while (current_record < sorted_records + length) { | ||
750 | 417 | + if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { | ||
751 | 418 | + os_aio_simulated_wake_handler_threads(); | ||
752 | 419 | + goto end; | ||
753 | 420 | + } | ||
754 | 421 | + | ||
755 | 422 | + records_loaded[current_record - sorted_records] = TRUE; | ||
756 | 423 | + | ||
757 | 424 | + page_no = current_record->page_no; | ||
758 | 425 | + | ||
759 | 426 | + if (!fil_area_is_exist(space_id, zip_size, page_no, 0, | ||
760 | 427 | + zip_size ? | ||
761 | 428 | + zip_size : UNIV_PAGE_SIZE)) { | ||
762 | 429 | + break; | ||
763 | 430 | + } | ||
764 | 290 | + | 431 | + |
765 | 291 | + tablespace_version = fil_space_get_version(space_id); | 432 | + tablespace_version = fil_space_get_version(space_id); |
766 | 292 | + | 433 | + |
767 | 293 | + req++; | 434 | + req++; |
770 | 294 | + reads += buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE | 435 | + |
771 | 295 | + | OS_AIO_SIMULATED_WAKE_LATER, | 436 | + /* do not issue more than srv_io_capacity requests per |
772 | 437 | + second */ | ||
773 | 438 | + if (req % srv_io_capacity == 0) { | ||
774 | 439 | + os_aio_simulated_wake_handler_threads(); | ||
775 | 440 | + buf_flush_free_margin(FALSE); | ||
776 | 441 | + | ||
777 | 442 | + ullint loop_usecs = ut_time_us(NULL) - | ||
778 | 443 | + loop_timer; | ||
779 | 444 | + | ||
780 | 445 | + if (loop_usecs < 1000000) { | ||
781 | 446 | + os_thread_sleep(1000000 - loop_usecs); | ||
782 | 447 | + } | ||
783 | 448 | + | ||
784 | 449 | + loop_timer = ut_time_us(NULL); | ||
785 | 450 | + } | ||
786 | 451 | + | ||
787 | 452 | + reads += buf_read_page_low(&err, | ||
788 | 453 | + FALSE, | ||
789 | 454 | + BUF_READ_ANY_PAGE | | ||
790 | 455 | + OS_AIO_SIMULATED_WAKE_LATER, | ||
791 | 296 | + space_id, zip_size, TRUE, | 456 | + space_id, zip_size, TRUE, |
793 | 297 | + tablespace_version, page_no, NULL); | 457 | + tablespace_version, page_no, |
794 | 458 | + NULL); | ||
795 | 298 | + buf_LRU_stat_inc_io(); | 459 | + buf_LRU_stat_inc_io(); |
796 | 460 | + | ||
797 | 461 | + srv_lru_restore_loaded_pages++; | ||
798 | 462 | + | ||
799 | 463 | + next_record = current_record + 1; | ||
800 | 464 | + | ||
801 | 465 | + if (next_record >= sorted_records + length || | ||
802 | 466 | + current_record->space_id != next_record->space_id || | ||
803 | 467 | + current_record->page_no + 1 != | ||
804 | 468 | + next_record->page_no) { | ||
805 | 469 | + break; | ||
806 | 470 | + } | ||
807 | 471 | + | ||
808 | 472 | + current_record = next_record; | ||
809 | 299 | + } | 473 | + } |
810 | 300 | + } | 474 | + } |
811 | 301 | + | 475 | + |
812 | @@ -314,6 +488,10 @@ | |||
813 | 314 | + ut_free(buffer_base); | 488 | + ut_free(buffer_base); |
814 | 315 | + if (records) | 489 | + if (records) |
815 | 316 | + ut_free(records); | 490 | + ut_free(records); |
816 | 491 | + if (sorted_records) | ||
817 | 492 | + ut_free(sorted_records); | ||
818 | 493 | + if (records_loaded) | ||
819 | 494 | + ut_free(records_loaded); | ||
820 | 317 | + | 495 | + |
821 | 318 | + return(ret); | 496 | + return(ret); |
822 | 319 | +} | 497 | +} |
823 | @@ -322,8 +500,8 @@ | |||
824 | 322 | /**********************************************************************//** | 500 | /**********************************************************************//** |
825 | 323 | Validates the LRU list. | 501 | Validates the LRU list. |
826 | 324 | diff -ruN a/storage/innodb_plugin/buf/buf0rea.c b/storage/innodb_plugin/buf/buf0rea.c | 502 | diff -ruN a/storage/innodb_plugin/buf/buf0rea.c b/storage/innodb_plugin/buf/buf0rea.c |
829 | 325 | --- a/storage/innodb_plugin/buf/buf0rea.c 2010-08-27 16:32:40.293411717 +0900 | 503 | --- a/storage/innodb_plugin/buf/buf0rea.c 2011-01-11 19:07:53.000000000 +0300 |
830 | 326 | +++ b/storage/innodb_plugin/buf/buf0rea.c 2010-08-27 16:34:33.863409016 +0900 | 504 | +++ b/storage/innodb_plugin/buf/buf0rea.c 2011-01-12 19:46:02.000000000 +0300 |
831 | 327 | @@ -56,7 +56,7 @@ | 505 | @@ -56,7 +56,7 @@ |
832 | 328 | which case it is never read into the pool, or if the tablespace does | 506 | which case it is never read into the pool, or if the tablespace does |
833 | 329 | not exist or is being dropped | 507 | not exist or is being dropped |
834 | @@ -334,8 +512,8 @@ | |||
835 | 334 | buf_read_page_low( | 512 | buf_read_page_low( |
836 | 335 | /*==============*/ | 513 | /*==============*/ |
837 | 336 | diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c | 514 | diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c |
840 | 337 | --- a/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:32:40.298411400 +0900 | 515 | --- a/storage/innodb_plugin/fil/fil0fil.c 2011-01-11 19:07:53.000000000 +0300 |
841 | 338 | +++ b/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:34:33.868058362 +0900 | 516 | +++ b/storage/innodb_plugin/fil/fil0fil.c 2011-01-12 19:46:02.000000000 +0300 |
842 | 339 | @@ -4915,6 +4915,78 @@ | 517 | @@ -4915,6 +4915,78 @@ |
843 | 340 | return(DB_SUCCESS); | 518 | return(DB_SUCCESS); |
844 | 341 | } | 519 | } |
845 | @@ -416,32 +594,60 @@ | |||
846 | 416 | /**********************************************************************//** | 594 | /**********************************************************************//** |
847 | 417 | Waits for an aio operation to complete. This function is used to write the | 595 | Waits for an aio operation to complete. This function is used to write the |
848 | 418 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc | 596 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc |
852 | 419 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-10-01 09:57:56.486228425 +0900 | 597 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2011-01-11 19:07:53.000000000 +0300 |
853 | 420 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-10-01 10:00:13.292228546 +0900 | 598 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2011-01-12 19:46:02.000000000 +0300 |
854 | 421 | @@ -11473,6 +11473,12 @@ | 599 | @@ -554,6 +554,10 @@ |
855 | 600 | (char*) &export_vars.innodb_log_write_requests, SHOW_LONG}, | ||
856 | 601 | {"log_writes", | ||
857 | 602 | (char*) &export_vars.innodb_log_writes, SHOW_LONG}, | ||
858 | 603 | + {"lru_restore_loaded_pages", | ||
859 | 604 | + (char*) &export_vars.innodb_lru_restore_loaded_pages, SHOW_LONG}, | ||
860 | 605 | + {"lru_restore_total_pages", | ||
861 | 606 | + (char*) &export_vars.innodb_lru_restore_total_pages, SHOW_LONG}, | ||
862 | 607 | {"os_log_fsyncs", | ||
863 | 608 | (char*) &export_vars.innodb_os_log_fsyncs, SHOW_LONG}, | ||
864 | 609 | {"os_log_pending_fsyncs", | ||
865 | 610 | @@ -11473,6 +11477,27 @@ | ||
866 | 422 | "Limit the allocated memory for dictionary cache. (0: unlimited)", | 611 | "Limit the allocated memory for dictionary cache. (0: unlimited)", |
867 | 423 | NULL, NULL, 0, 0, LONG_MAX, 0); | 612 | NULL, NULL, 0, 0, LONG_MAX, 0); |
868 | 424 | 613 | ||
869 | 425 | +static MYSQL_SYSVAR_UINT(auto_lru_dump, srv_auto_lru_dump, | 614 | +static MYSQL_SYSVAR_UINT(auto_lru_dump, srv_auto_lru_dump, |
870 | 426 | + PLUGIN_VAR_RQCMDARG, | 615 | + PLUGIN_VAR_RQCMDARG, |
871 | 427 | + "Time in seconds between automatic buffer pool dumps. " | 616 | + "Time in seconds between automatic buffer pool dumps. " |
873 | 428 | + "0 (the default) disables automatic dumps.", | 617 | + "0 (the default) disables automatic dumps. A non-zero value " |
874 | 618 | + "also enables restoring LRU automatically on startup.", | ||
875 | 429 | + NULL, NULL, 0, 0, UINT_MAX32, 0); | 619 | + NULL, NULL, 0, 0, UINT_MAX32, 0); |
876 | 430 | + | 620 | + |
877 | 621 | +static MYSQL_SYSVAR_ULONG(lru_load_max_entries, srv_lru_load_max_entries, | ||
878 | 622 | + PLUGIN_VAR_RQCMDARG, | ||
879 | 623 | + "Maximum number of LRU entries to restore. The default is 512k entries. " | ||
880 | 624 | + "Consecutive pages are merged and only count as one, so you will probably " | ||
881 | 625 | + "load more pages than this number of LRU entries.", | ||
882 | 626 | + NULL, NULL, 512*1024UL, 1UL, ULONG_MAX, 0); | ||
883 | 627 | + | ||
884 | 628 | +static MYSQL_SYSVAR_BOOL(lru_dump_old_pages, srv_lru_dump_old_pages, | ||
885 | 629 | + PLUGIN_VAR_NOCMDARG, | ||
886 | 630 | + "If enabled, will also dump old pages from the LRU. " | ||
887 | 631 | + "The default is to only dump young pages.", | ||
888 | 632 | + NULL, NULL, FALSE); | ||
889 | 633 | + | ||
890 | 634 | + | ||
891 | 431 | static struct st_mysql_sys_var* innobase_system_variables[]= { | 635 | static struct st_mysql_sys_var* innobase_system_variables[]= { |
892 | 432 | MYSQL_SYSVAR(additional_mem_pool_size), | 636 | MYSQL_SYSVAR(additional_mem_pool_size), |
893 | 433 | MYSQL_SYSVAR(autoextend_increment), | 637 | MYSQL_SYSVAR(autoextend_increment), |
895 | 434 | @@ -11555,6 +11561,7 @@ | 638 | @@ -11555,6 +11580,9 @@ |
896 | 435 | #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ | 639 | #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ |
897 | 436 | MYSQL_SYSVAR(read_ahead_threshold), | 640 | MYSQL_SYSVAR(read_ahead_threshold), |
898 | 437 | MYSQL_SYSVAR(io_capacity), | 641 | MYSQL_SYSVAR(io_capacity), |
899 | 438 | + MYSQL_SYSVAR(auto_lru_dump), | 642 | + MYSQL_SYSVAR(auto_lru_dump), |
900 | 643 | + MYSQL_SYSVAR(lru_load_max_entries), | ||
901 | 644 | + MYSQL_SYSVAR(lru_dump_old_pages), | ||
902 | 439 | MYSQL_SYSVAR(use_purge_thread), | 645 | MYSQL_SYSVAR(use_purge_thread), |
903 | 440 | NULL | 646 | NULL |
904 | 441 | }; | 647 | }; |
905 | 442 | diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc | 648 | diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc |
908 | 443 | --- a/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:29:12.540979608 +0900 | 649 | --- a/storage/innodb_plugin/handler/i_s.cc 2011-01-11 19:07:53.000000000 +0300 |
909 | 444 | +++ b/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:34:33.873058189 +0900 | 650 | +++ b/storage/innodb_plugin/handler/i_s.cc 2011-01-12 19:46:02.000000000 +0300 |
910 | 445 | @@ -46,6 +46,7 @@ | 651 | @@ -46,6 +46,7 @@ |
911 | 446 | #include "trx0rseg.h" /* for trx_rseg_struct */ | 652 | #include "trx0rseg.h" /* for trx_rseg_struct */ |
912 | 447 | #include "trx0sys.h" /* for trx_sys */ | 653 | #include "trx0sys.h" /* for trx_sys */ |
913 | @@ -488,8 +694,8 @@ | |||
914 | 488 | field_store_string(i_s_table->field[0], | 694 | field_store_string(i_s_table->field[0], |
915 | 489 | "Undefined XTRA_* command."); | 695 | "Undefined XTRA_* command."); |
916 | 490 | diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h | 696 | diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h |
919 | 491 | --- a/storage/innodb_plugin/handler/innodb_patch_info.h 2010-08-27 16:32:40.313021803 +0900 | 697 | --- a/storage/innodb_plugin/handler/innodb_patch_info.h 2011-01-11 19:07:53.000000000 +0300 |
920 | 492 | +++ b/storage/innodb_plugin/handler/innodb_patch_info.h 2010-08-27 16:34:33.871059345 +0900 | 698 | +++ b/storage/innodb_plugin/handler/innodb_patch_info.h 2011-01-12 19:46:02.000000000 +0300 |
921 | 493 | @@ -41,5 +41,6 @@ | 699 | @@ -41,5 +41,6 @@ |
922 | 494 | {"innodb_admin_command_base","XtraDB specific command interface through i_s","","http://www.percona.com/docs/wiki/percona-xtradb"}, | 700 | {"innodb_admin_command_base","XtraDB specific command interface through i_s","","http://www.percona.com/docs/wiki/percona-xtradb"}, |
923 | 495 | {"innodb_show_lock_name","Show mutex/lock name instead of crated file/line","","http://www.percona.com/docs/wiki/percona-xtradb"}, | 701 | {"innodb_show_lock_name","Show mutex/lock name instead of crated file/line","","http://www.percona.com/docs/wiki/percona-xtradb"}, |
924 | @@ -498,8 +704,8 @@ | |||
925 | 498 | {NULL, NULL, NULL, NULL} | 704 | {NULL, NULL, NULL, NULL} |
926 | 499 | }; | 705 | }; |
927 | 500 | diff -ruN a/storage/innodb_plugin/include/buf0lru.h b/storage/innodb_plugin/include/buf0lru.h | 706 | diff -ruN a/storage/innodb_plugin/include/buf0lru.h b/storage/innodb_plugin/include/buf0lru.h |
930 | 501 | --- a/storage/innodb_plugin/include/buf0lru.h 2010-08-27 16:13:11.085978393 +0900 | 707 | --- a/storage/innodb_plugin/include/buf0lru.h 2011-01-11 19:07:52.000000000 +0300 |
931 | 502 | +++ b/storage/innodb_plugin/include/buf0lru.h 2010-08-27 16:34:33.875100517 +0900 | 708 | +++ b/storage/innodb_plugin/include/buf0lru.h 2011-01-11 19:07:54.000000000 +0300 |
932 | 503 | @@ -213,6 +213,18 @@ | 709 | @@ -213,6 +213,18 @@ |
933 | 504 | void | 710 | void |
934 | 505 | buf_LRU_stat_update(void); | 711 | buf_LRU_stat_update(void); |
935 | @@ -520,8 +726,8 @@ | |||
936 | 520 | #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG | 726 | #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG |
937 | 521 | /**********************************************************************//** | 727 | /**********************************************************************//** |
938 | 522 | diff -ruN a/storage/innodb_plugin/include/buf0rea.h b/storage/innodb_plugin/include/buf0rea.h | 728 | diff -ruN a/storage/innodb_plugin/include/buf0rea.h b/storage/innodb_plugin/include/buf0rea.h |
941 | 523 | --- a/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:32:40.314021595 +0900 | 729 | --- a/storage/innodb_plugin/include/buf0rea.h 2011-01-11 19:07:53.000000000 +0300 |
942 | 524 | +++ b/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:34:33.877059445 +0900 | 730 | +++ b/storage/innodb_plugin/include/buf0rea.h 2011-01-11 19:07:54.000000000 +0300 |
943 | 525 | @@ -31,6 +31,37 @@ | 731 | @@ -31,6 +31,37 @@ |
944 | 526 | #include "buf0types.h" | 732 | #include "buf0types.h" |
945 | 527 | 733 | ||
946 | @@ -561,8 +767,8 @@ | |||
947 | 561 | buffer buf_pool if it is not already there. Sets the io_fix flag and sets | 767 | buffer buf_pool if it is not already there. Sets the io_fix flag and sets |
948 | 562 | an exclusive lock on the buffer frame. The flag is cleared and the x-lock | 768 | an exclusive lock on the buffer frame. The flag is cleared and the x-lock |
949 | 563 | diff -ruN a/storage/innodb_plugin/include/fil0fil.h b/storage/innodb_plugin/include/fil0fil.h | 769 | diff -ruN a/storage/innodb_plugin/include/fil0fil.h b/storage/innodb_plugin/include/fil0fil.h |
952 | 564 | --- a/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:32:40.315012507 +0900 | 770 | --- a/storage/innodb_plugin/include/fil0fil.h 2011-01-11 19:07:53.000000000 +0300 |
953 | 565 | +++ b/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:34:33.878063455 +0900 | 771 | +++ b/storage/innodb_plugin/include/fil0fil.h 2011-01-12 19:46:02.000000000 +0300 |
954 | 566 | @@ -643,6 +643,22 @@ | 772 | @@ -643,6 +643,22 @@ |
955 | 567 | void* message, /*!< in: message for aio handler if non-sync | 773 | void* message, /*!< in: message for aio handler if non-sync |
956 | 568 | aio used, else ignored */ | 774 | aio used, else ignored */ |
957 | @@ -587,19 +793,33 @@ | |||
958 | 587 | Waits for an aio operation to complete. This function is used to write the | 793 | Waits for an aio operation to complete. This function is used to write the |
959 | 588 | handler for completed requests. The aio array of pending requests is divided | 794 | handler for completed requests. The aio array of pending requests is divided |
960 | 589 | diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h | 795 | diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h |
964 | 590 | --- a/storage/innodb_plugin/include/srv0srv.h 2010-10-01 09:57:56.500228711 +0900 | 796 | --- a/storage/innodb_plugin/include/srv0srv.h 2011-01-11 19:07:53.000000000 +0300 |
965 | 591 | +++ b/storage/innodb_plugin/include/srv0srv.h 2010-10-01 10:00:13.302223409 +0900 | 797 | +++ b/storage/innodb_plugin/include/srv0srv.h 2011-01-12 19:46:02.000000000 +0300 |
966 | 592 | @@ -334,6 +334,9 @@ | 798 | @@ -334,6 +334,23 @@ |
967 | 593 | reading of a disk page */ | 799 | reading of a disk page */ |
968 | 594 | extern ulint srv_buf_pool_reads; | 800 | extern ulint srv_buf_pool_reads; |
969 | 595 | 801 | ||
970 | 596 | +/** Time in seconds between automatic buffer pool dumps */ | 802 | +/** Time in seconds between automatic buffer pool dumps */ |
971 | 597 | +extern uint srv_auto_lru_dump; | 803 | +extern uint srv_auto_lru_dump; |
972 | 598 | + | 804 | + |
973 | 805 | +/** Maximum number of LRU entries to restore | ||
974 | 806 | +Consecutive pages are merged and only count as one, so you will probably | ||
975 | 807 | +load more pages than this number of LRU entries. */ | ||
976 | 808 | +extern ulint srv_lru_load_max_entries; | ||
977 | 809 | + | ||
978 | 810 | +/** If enabled, will also dump old pages from the LRU */ | ||
979 | 811 | +extern my_bool srv_lru_dump_old_pages; | ||
980 | 812 | + | ||
981 | 813 | +/** Number of buffer pool pages already restored */ | ||
982 | 814 | +extern ulint srv_lru_restore_loaded_pages; | ||
983 | 815 | + | ||
984 | 816 | +/** Number of buffer pool pages in restore list */ | ||
985 | 817 | +extern ulint srv_lru_restore_total_pages; | ||
986 | 818 | + | ||
987 | 599 | /** Status variables to be passed to MySQL */ | 819 | /** Status variables to be passed to MySQL */ |
988 | 600 | typedef struct export_var_struct export_struc; | 820 | typedef struct export_var_struct export_struc; |
989 | 601 | 821 | ||
991 | 602 | @@ -602,6 +605,16 @@ | 822 | @@ -602,6 +619,16 @@ |
992 | 603 | /*=====================*/ | 823 | /*=====================*/ |
993 | 604 | void* arg); /*!< in: a dummy parameter required by | 824 | void* arg); /*!< in: a dummy parameter required by |
994 | 605 | os_thread_create */ | 825 | os_thread_create */ |
995 | @@ -616,28 +836,60 @@ | |||
996 | 616 | /******************************************************************//** | 836 | /******************************************************************//** |
997 | 617 | Outputs to a file the output of the InnoDB Monitor. | 837 | Outputs to a file the output of the InnoDB Monitor. |
998 | 618 | @return FALSE if not all information printed | 838 | @return FALSE if not all information printed |
999 | 839 | @@ -683,6 +710,11 @@ | ||
1000 | 840 | ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */ | ||
1001 | 841 | ulint innodb_rows_updated; /*!< srv_n_rows_updated */ | ||
1002 | 842 | ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */ | ||
1003 | 843 | + | ||
1004 | 844 | + ulint innodb_lru_restore_loaded_pages; /*!<srv_lru_restore_loaded_pages | ||
1005 | 845 | + */ | ||
1006 | 846 | + ulint innodb_lru_restore_total_pages; /*!<srv_lru_restore_total_pages | ||
1007 | 847 | + */ | ||
1008 | 848 | }; | ||
1009 | 849 | |||
1010 | 850 | /** The server system struct */ | ||
1011 | 619 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c | 851 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c |
1015 | 620 | --- a/storage/innodb_plugin/srv/srv0srv.c 2010-10-01 09:57:56.516255101 +0900 | 852 | --- a/storage/innodb_plugin/srv/srv0srv.c 2011-01-11 19:07:53.000000000 +0300 |
1016 | 621 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-10-01 10:00:13.304230973 +0900 | 853 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2011-01-12 19:46:02.000000000 +0300 |
1017 | 622 | @@ -298,6 +298,9 @@ | 854 | @@ -298,6 +298,23 @@ |
1018 | 623 | reading of a disk page */ | 855 | reading of a disk page */ |
1019 | 624 | UNIV_INTERN ulint srv_buf_pool_reads = 0; | 856 | UNIV_INTERN ulint srv_buf_pool_reads = 0; |
1020 | 625 | 857 | ||
1021 | 626 | +/** Time in seconds between automatic buffer pool dumps */ | 858 | +/** Time in seconds between automatic buffer pool dumps */ |
1022 | 627 | +UNIV_INTERN uint srv_auto_lru_dump = 0; | 859 | +UNIV_INTERN uint srv_auto_lru_dump = 0; |
1023 | 628 | + | 860 | + |
1024 | 861 | +/** Maximum number of LRU entries to restore | ||
1025 | 862 | +Consecutive pages are merged and only count as one, so you will probably | ||
1026 | 863 | +load more pages than this number of LRU entries. */ | ||
1027 | 864 | +UNIV_INTERN ulint srv_lru_load_max_entries = 512*1024; | ||
1028 | 865 | + | ||
1029 | 866 | +/** If enabled, will also dump old pages from the LRU */ | ||
1030 | 867 | +UNIV_INTERN my_bool srv_lru_dump_old_pages = FALSE; | ||
1031 | 868 | + | ||
1032 | 869 | +/** Number of buffer pool pages already restored */ | ||
1033 | 870 | +UNIV_INTERN ulint srv_lru_restore_loaded_pages = 0; | ||
1034 | 871 | + | ||
1035 | 872 | +/** Number of buffer pool pages in restore list */ | ||
1036 | 873 | +UNIV_INTERN ulint srv_lru_restore_total_pages = 0; | ||
1037 | 874 | + | ||
1038 | 629 | /* structure to pass status variables to MySQL */ | 875 | /* structure to pass status variables to MySQL */ |
1039 | 630 | UNIV_INTERN export_struc export_vars; | 876 | UNIV_INTERN export_struc export_vars; |
1040 | 631 | 877 | ||
1050 | 632 | @@ -2537,6 +2540,56 @@ | 878 | @@ -2178,6 +2195,10 @@ |
1051 | 633 | /* We count the number of threads in os_thread_exit(). A created | 879 | export_vars.innodb_rows_inserted = srv_n_rows_inserted; |
1052 | 634 | thread should always use that to exit and not use return() to exit. */ | 880 | export_vars.innodb_rows_updated = srv_n_rows_updated; |
1053 | 635 | 881 | export_vars.innodb_rows_deleted = srv_n_rows_deleted; | |
1054 | 636 | + os_thread_exit(NULL); | 882 | + export_vars.innodb_lru_restore_loaded_pages = |
1055 | 637 | + | 883 | + srv_lru_restore_loaded_pages; |
1056 | 638 | + OS_THREAD_DUMMY_RETURN; | 884 | + export_vars.innodb_lru_restore_total_pages = |
1057 | 639 | +} | 885 | + srv_lru_restore_total_pages; |
1058 | 640 | + | 886 | |
1059 | 887 | mutex_exit(&srv_innodb_monitor_mutex); | ||
1060 | 888 | } | ||
1061 | 889 | @@ -2542,6 +2563,60 @@ | ||
1062 | 890 | OS_THREAD_DUMMY_RETURN; | ||
1063 | 891 | } | ||
1064 | 892 | |||
1065 | 641 | +/*********************************************************************//** | 893 | +/*********************************************************************//** |
1066 | 642 | +A thread which restores the buffer pool from a dump file on startup and does | 894 | +A thread which restores the buffer pool from a dump file on startup and does |
1067 | 643 | +periodic buffer pool dumps. | 895 | +periodic buffer pool dumps. |
1068 | @@ -662,10 +914,14 @@ | |||
1069 | 662 | + if (srv_auto_lru_dump) | 914 | + if (srv_auto_lru_dump) |
1070 | 663 | + buf_LRU_file_restore(); | 915 | + buf_LRU_file_restore(); |
1071 | 664 | + | 916 | + |
1072 | 917 | + if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { | ||
1073 | 918 | + goto exit_func; | ||
1074 | 919 | + } | ||
1075 | 920 | + | ||
1076 | 665 | + last_dump_time = time(NULL); | 921 | + last_dump_time = time(NULL); |
1077 | 666 | + | 922 | + |
1078 | 667 | +loop: | 923 | +loop: |
1080 | 668 | + os_thread_sleep(5000000); | 924 | + os_thread_sleep(1000000); |
1081 | 669 | + | 925 | + |
1082 | 670 | + if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { | 926 | + if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { |
1083 | 671 | + goto exit_func; | 927 | + goto exit_func; |
1084 | @@ -683,12 +939,17 @@ | |||
1085 | 683 | + /* We count the number of threads in os_thread_exit(). A created | 939 | + /* We count the number of threads in os_thread_exit(). A created |
1086 | 684 | + thread should always use that to exit and not use return() to exit. */ | 940 | + thread should always use that to exit and not use return() to exit. */ |
1087 | 685 | + | 941 | + |
1091 | 686 | os_thread_exit(NULL); | 942 | + os_thread_exit(NULL); |
1092 | 687 | 943 | + | |
1093 | 688 | OS_THREAD_DUMMY_RETURN; | 944 | + OS_THREAD_DUMMY_RETURN; |
1094 | 945 | +} | ||
1095 | 946 | + | ||
1096 | 947 | /*******************************************************************//** | ||
1097 | 948 | Tells the InnoDB server that there has been activity in the database | ||
1098 | 949 | and wakes up the master thread if it is suspended (not sleeping). Used | ||
1099 | 689 | diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c | 950 | diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c |
1102 | 690 | --- a/storage/innodb_plugin/srv/srv0start.c 2010-10-01 09:57:56.420229366 +0900 | 951 | --- a/storage/innodb_plugin/srv/srv0start.c 2011-01-11 19:07:53.000000000 +0300 |
1103 | 691 | +++ b/storage/innodb_plugin/srv/srv0start.c 2010-10-01 10:00:13.309260428 +0900 | 952 | +++ b/storage/innodb_plugin/srv/srv0start.c 2011-01-12 19:46:02.000000000 +0300 |
1104 | 692 | @@ -126,9 +126,9 @@ | 953 | @@ -126,9 +126,9 @@ |
1105 | 693 | static ulint ios; | 954 | static ulint ios; |
1106 | 694 | 955 | ||
1107 | 695 | 956 | ||
1108 | === modified file 'innodb_pass_corrupt_table.patch' | |||
1109 | --- innodb_pass_corrupt_table.patch 2010-12-16 11:35:26 +0000 | |||
1110 | +++ innodb_pass_corrupt_table.patch 2011-01-12 17:48:16 +0000 | |||
1111 | @@ -778,7 +778,7 @@ | |||
1112 | 778 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc | 778 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc |
1113 | 779 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:38:38.249059616 +0900 | 779 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:38:38.249059616 +0900 |
1114 | 780 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:39:02.960021471 +0900 | 780 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:39:02.960021471 +0900 |
1116 | 781 | @@ -3716,6 +3716,12 @@ | 781 | @@ -3720,6 +3720,12 @@ |
1117 | 782 | DBUG_RETURN(1); | 782 | DBUG_RETURN(1); |
1118 | 783 | } | 783 | } |
1119 | 784 | 784 | ||
1120 | @@ -791,7 +791,7 @@ | |||
1121 | 791 | /* Create buffers for packing the fields of a record. Why | 791 | /* Create buffers for packing the fields of a record. Why |
1122 | 792 | table->reclength did not work here? Obviously, because char | 792 | table->reclength did not work here? Obviously, because char |
1123 | 793 | fields when packed actually became 1 byte longer, when we also | 793 | fields when packed actually became 1 byte longer, when we also |
1125 | 794 | @@ -3743,6 +3749,19 @@ | 794 | @@ -3747,6 +3753,19 @@ |
1126 | 795 | /* Get pointer to a table object in InnoDB dictionary cache */ | 795 | /* Get pointer to a table object in InnoDB dictionary cache */ |
1127 | 796 | ib_table = dict_table_get(norm_name, TRUE); | 796 | ib_table = dict_table_get(norm_name, TRUE); |
1128 | 797 | 797 | ||
1129 | @@ -811,7 +811,7 @@ | |||
1130 | 811 | if (NULL == ib_table) { | 811 | if (NULL == ib_table) { |
1131 | 812 | if (is_part && retries < 10) { | 812 | if (is_part && retries < 10) { |
1132 | 813 | ++retries; | 813 | ++retries; |
1134 | 814 | @@ -4909,6 +4928,10 @@ | 814 | @@ -4913,6 +4932,10 @@ |
1135 | 815 | 815 | ||
1136 | 816 | ha_statistic_increment(&SSV::ha_write_count); | 816 | ha_statistic_increment(&SSV::ha_write_count); |
1137 | 817 | 817 | ||
1138 | @@ -822,7 +822,7 @@ | |||
1139 | 822 | if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) | 822 | if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) |
1140 | 823 | table->timestamp_field->set_time(); | 823 | table->timestamp_field->set_time(); |
1141 | 824 | 824 | ||
1143 | 825 | @@ -5126,6 +5149,10 @@ | 825 | @@ -5130,6 +5153,10 @@ |
1144 | 826 | func_exit: | 826 | func_exit: |
1145 | 827 | innobase_active_small(); | 827 | innobase_active_small(); |
1146 | 828 | 828 | ||
1147 | @@ -833,7 +833,7 @@ | |||
1148 | 833 | DBUG_RETURN(error_result); | 833 | DBUG_RETURN(error_result); |
1149 | 834 | } | 834 | } |
1150 | 835 | 835 | ||
1152 | 836 | @@ -5302,6 +5329,10 @@ | 836 | @@ -5306,6 +5333,10 @@ |
1153 | 837 | 837 | ||
1154 | 838 | ha_statistic_increment(&SSV::ha_update_count); | 838 | ha_statistic_increment(&SSV::ha_update_count); |
1155 | 839 | 839 | ||
1156 | @@ -844,7 +844,7 @@ | |||
1157 | 844 | if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) | 844 | if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) |
1158 | 845 | table->timestamp_field->set_time(); | 845 | table->timestamp_field->set_time(); |
1159 | 846 | 846 | ||
1161 | 847 | @@ -5391,6 +5422,10 @@ | 847 | @@ -5395,6 +5426,10 @@ |
1162 | 848 | 848 | ||
1163 | 849 | innobase_active_small(); | 849 | innobase_active_small(); |
1164 | 850 | 850 | ||
1165 | @@ -855,7 +855,7 @@ | |||
1166 | 855 | DBUG_RETURN(error); | 855 | DBUG_RETURN(error); |
1167 | 856 | } | 856 | } |
1168 | 857 | 857 | ||
1170 | 858 | @@ -5412,6 +5447,10 @@ | 858 | @@ -5416,6 +5451,10 @@ |
1171 | 859 | 859 | ||
1172 | 860 | ha_statistic_increment(&SSV::ha_delete_count); | 860 | ha_statistic_increment(&SSV::ha_delete_count); |
1173 | 861 | 861 | ||
1174 | @@ -866,7 +866,7 @@ | |||
1175 | 866 | if (!prebuilt->upd_node) { | 866 | if (!prebuilt->upd_node) { |
1176 | 867 | row_get_prebuilt_update_vector(prebuilt); | 867 | row_get_prebuilt_update_vector(prebuilt); |
1177 | 868 | } | 868 | } |
1179 | 869 | @@ -5438,6 +5477,10 @@ | 869 | @@ -5442,6 +5481,10 @@ |
1180 | 870 | 870 | ||
1181 | 871 | innobase_active_small(); | 871 | innobase_active_small(); |
1182 | 872 | 872 | ||
1183 | @@ -877,7 +877,7 @@ | |||
1184 | 877 | DBUG_RETURN(error); | 877 | DBUG_RETURN(error); |
1185 | 878 | } | 878 | } |
1186 | 879 | 879 | ||
1188 | 880 | @@ -5677,6 +5720,10 @@ | 880 | @@ -5681,6 +5724,10 @@ |
1189 | 881 | 881 | ||
1190 | 882 | ha_statistic_increment(&SSV::ha_read_key_count); | 882 | ha_statistic_increment(&SSV::ha_read_key_count); |
1191 | 883 | 883 | ||
1192 | @@ -888,7 +888,7 @@ | |||
1193 | 888 | index = prebuilt->index; | 888 | index = prebuilt->index; |
1194 | 889 | 889 | ||
1195 | 890 | if (UNIV_UNLIKELY(index == NULL)) { | 890 | if (UNIV_UNLIKELY(index == NULL)) { |
1197 | 891 | @@ -5742,6 +5789,10 @@ | 891 | @@ -5746,6 +5793,10 @@ |
1198 | 892 | ret = DB_UNSUPPORTED; | 892 | ret = DB_UNSUPPORTED; |
1199 | 893 | } | 893 | } |
1200 | 894 | 894 | ||
1201 | @@ -899,7 +899,7 @@ | |||
1202 | 899 | switch (ret) { | 899 | switch (ret) { |
1203 | 900 | case DB_SUCCESS: | 900 | case DB_SUCCESS: |
1204 | 901 | error = 0; | 901 | error = 0; |
1206 | 902 | @@ -5852,6 +5903,10 @@ | 902 | @@ -5856,6 +5907,10 @@ |
1207 | 903 | { | 903 | { |
1208 | 904 | DBUG_ENTER("change_active_index"); | 904 | DBUG_ENTER("change_active_index"); |
1209 | 905 | 905 | ||
1210 | @@ -910,7 +910,7 @@ | |||
1211 | 910 | ut_ad(user_thd == ha_thd()); | 910 | ut_ad(user_thd == ha_thd()); |
1212 | 911 | ut_a(prebuilt->trx == thd_to_trx(user_thd)); | 911 | ut_a(prebuilt->trx == thd_to_trx(user_thd)); |
1213 | 912 | 912 | ||
1215 | 913 | @@ -5942,6 +5997,10 @@ | 913 | @@ -5946,6 +6001,10 @@ |
1216 | 914 | 914 | ||
1217 | 915 | DBUG_ENTER("general_fetch"); | 915 | DBUG_ENTER("general_fetch"); |
1218 | 916 | 916 | ||
1219 | @@ -921,7 +921,7 @@ | |||
1220 | 921 | ut_a(prebuilt->trx == thd_to_trx(user_thd)); | 921 | ut_a(prebuilt->trx == thd_to_trx(user_thd)); |
1221 | 922 | 922 | ||
1222 | 923 | innodb_srv_conc_enter_innodb(prebuilt->trx); | 923 | innodb_srv_conc_enter_innodb(prebuilt->trx); |
1224 | 924 | @@ -5951,6 +6010,10 @@ | 924 | @@ -5955,6 +6014,10 @@ |
1225 | 925 | 925 | ||
1226 | 926 | innodb_srv_conc_exit_innodb(prebuilt->trx); | 926 | innodb_srv_conc_exit_innodb(prebuilt->trx); |
1227 | 927 | 927 | ||
1228 | @@ -932,7 +932,7 @@ | |||
1229 | 932 | switch (ret) { | 932 | switch (ret) { |
1230 | 933 | case DB_SUCCESS: | 933 | case DB_SUCCESS: |
1231 | 934 | error = 0; | 934 | error = 0; |
1233 | 935 | @@ -7201,6 +7264,10 @@ | 935 | @@ -7205,6 +7268,10 @@ |
1234 | 936 | DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND); | 936 | DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND); |
1235 | 937 | } | 937 | } |
1236 | 938 | 938 | ||
1237 | @@ -943,7 +943,7 @@ | |||
1238 | 943 | /* Truncate the table in InnoDB */ | 943 | /* Truncate the table in InnoDB */ |
1239 | 944 | 944 | ||
1240 | 945 | error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx); | 945 | error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx); |
1242 | 946 | @@ -7209,6 +7276,10 @@ | 946 | @@ -7213,6 +7280,10 @@ |
1243 | 947 | goto fallback; | 947 | goto fallback; |
1244 | 948 | } | 948 | } |
1245 | 949 | 949 | ||
1246 | @@ -954,7 +954,7 @@ | |||
1247 | 954 | error = convert_error_code_to_mysql(error, prebuilt->table->flags, | 954 | error = convert_error_code_to_mysql(error, prebuilt->table->flags, |
1248 | 955 | NULL); | 955 | NULL); |
1249 | 956 | 956 | ||
1251 | 957 | @@ -7721,6 +7792,16 @@ | 957 | @@ -7725,6 +7796,16 @@ |
1252 | 958 | return(ranges + (double) rows / (double) total_rows * time_for_scan); | 958 | return(ranges + (double) rows / (double) total_rows * time_for_scan); |
1253 | 959 | } | 959 | } |
1254 | 960 | 960 | ||
1255 | @@ -971,7 +971,7 @@ | |||
1256 | 971 | /*********************************************************************//** | 971 | /*********************************************************************//** |
1257 | 972 | Calculates the key number used inside MySQL for an Innobase index. We will | 972 | Calculates the key number used inside MySQL for an Innobase index. We will |
1258 | 973 | first check the "index translation table" for a match of the index to get | 973 | first check the "index translation table" for a match of the index to get |
1260 | 974 | @@ -7842,7 +7923,7 @@ | 974 | @@ -7846,7 +7927,7 @@ |
1261 | 975 | ib_table = prebuilt->table; | 975 | ib_table = prebuilt->table; |
1262 | 976 | 976 | ||
1263 | 977 | if (flag & HA_STATUS_TIME) { | 977 | if (flag & HA_STATUS_TIME) { |
1264 | @@ -980,7 +980,7 @@ | |||
1265 | 980 | /* In sql_show we call with this flag: update | 980 | /* In sql_show we call with this flag: update |
1266 | 981 | then statistics so that they are up-to-date */ | 981 | then statistics so that they are up-to-date */ |
1267 | 982 | 982 | ||
1269 | 983 | @@ -8133,10 +8214,18 @@ | 983 | @@ -8137,10 +8218,18 @@ |
1270 | 984 | THD* thd, /*!< in: connection thread handle */ | 984 | THD* thd, /*!< in: connection thread handle */ |
1271 | 985 | HA_CHECK_OPT* check_opt) /*!< in: currently ignored */ | 985 | HA_CHECK_OPT* check_opt) /*!< in: currently ignored */ |
1272 | 986 | { | 986 | { |
1273 | @@ -999,7 +999,7 @@ | |||
1274 | 999 | return(0); | 999 | return(0); |
1275 | 1000 | } | 1000 | } |
1276 | 1001 | 1001 | ||
1278 | 1002 | @@ -8318,6 +8407,10 @@ | 1002 | @@ -8322,6 +8411,10 @@ |
1279 | 1003 | my_error(ER_QUERY_INTERRUPTED, MYF(0)); | 1003 | my_error(ER_QUERY_INTERRUPTED, MYF(0)); |
1280 | 1004 | } | 1004 | } |
1281 | 1005 | 1005 | ||
1282 | @@ -1010,7 +1010,7 @@ | |||
1283 | 1010 | DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT); | 1010 | DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT); |
1284 | 1011 | } | 1011 | } |
1285 | 1012 | 1012 | ||
1287 | 1013 | @@ -9043,6 +9136,10 @@ | 1013 | @@ -9047,6 +9140,10 @@ |
1288 | 1014 | 1014 | ||
1289 | 1015 | update_thd(thd); | 1015 | update_thd(thd); |
1290 | 1016 | 1016 | ||
1291 | @@ -1021,9 +1021,9 @@ | |||
1292 | 1021 | if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) { | 1021 | if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) { |
1293 | 1022 | ut_print_timestamp(stderr); | 1022 | ut_print_timestamp(stderr); |
1294 | 1023 | fprintf(stderr, | 1023 | fprintf(stderr, |
1298 | 1024 | @@ -11487,6 +11584,14 @@ | 1024 | @@ -11506,6 +11603,14 @@ |
1299 | 1025 | "0 (the default) disables automatic dumps.", | 1025 | NULL, NULL, FALSE); |
1300 | 1026 | NULL, NULL, 0, 0, UINT_MAX32, 0); | 1026 | |
1301 | 1027 | 1027 | ||
1302 | 1028 | +static MYSQL_SYSVAR_ULONG(pass_corrupt_table, srv_pass_corrupt_table, | 1028 | +static MYSQL_SYSVAR_ULONG(pass_corrupt_table, srv_pass_corrupt_table, |
1303 | 1029 | + PLUGIN_VAR_RQCMDARG, | 1029 | + PLUGIN_VAR_RQCMDARG, |
1304 | @@ -1036,9 +1036,9 @@ | |||
1305 | 1036 | static struct st_mysql_sys_var* innobase_system_variables[]= { | 1036 | static struct st_mysql_sys_var* innobase_system_variables[]= { |
1306 | 1037 | MYSQL_SYSVAR(additional_mem_pool_size), | 1037 | MYSQL_SYSVAR(additional_mem_pool_size), |
1307 | 1038 | MYSQL_SYSVAR(autoextend_increment), | 1038 | MYSQL_SYSVAR(autoextend_increment), |
1311 | 1039 | @@ -11572,6 +11677,7 @@ | 1039 | @@ -11593,6 +11698,7 @@ |
1312 | 1040 | MYSQL_SYSVAR(io_capacity), | 1040 | MYSQL_SYSVAR(lru_load_max_entries), |
1313 | 1041 | MYSQL_SYSVAR(auto_lru_dump), | 1041 | MYSQL_SYSVAR(lru_dump_old_pages), |
1314 | 1042 | MYSQL_SYSVAR(use_purge_thread), | 1042 | MYSQL_SYSVAR(use_purge_thread), |
1315 | 1043 | + MYSQL_SYSVAR(pass_corrupt_table), | 1043 | + MYSQL_SYSVAR(pass_corrupt_table), |
1316 | 1044 | NULL | 1044 | NULL |
1317 | @@ -1343,7 +1343,7 @@ | |||
1318 | 1343 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c | 1343 | diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c |
1319 | 1344 | --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:38:38.286989546 +0900 | 1344 | --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:38:38.286989546 +0900 |
1320 | 1345 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:39:03.048990992 +0900 | 1345 | +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:39:03.048990992 +0900 |
1322 | 1346 | @@ -402,6 +402,7 @@ | 1346 | @@ -416,6 +416,7 @@ |
1323 | 1347 | UNIV_INTERN ulint srv_adaptive_checkpoint = 0; /* 0: none 1: reflex 2: estimate */ | 1347 | UNIV_INTERN ulint srv_adaptive_checkpoint = 0; /* 0: none 1: reflex 2: estimate */ |
1324 | 1348 | 1348 | ||
1325 | 1349 | UNIV_INTERN ulint srv_expand_import = 0; /* 0:disable 1:enable */ | 1349 | UNIV_INTERN ulint srv_expand_import = 0; /* 0:disable 1:enable */ |
1326 | 1350 | 1350 | ||
1327 | === modified file 'innodb_separate_doublewrite.patch' | |||
1328 | --- innodb_separate_doublewrite.patch 2010-12-16 11:35:26 +0000 | |||
1329 | +++ innodb_separate_doublewrite.patch 2011-01-12 17:48:16 +0000 | |||
1330 | @@ -340,7 +340,7 @@ | |||
1331 | 340 | 340 | ||
1332 | 341 | /* Note: This variable can be set to on/off and any of the supported | 341 | /* Note: This variable can be set to on/off and any of the supported |
1333 | 342 | file formats in the configuration file, but can only be set to any | 342 | file formats in the configuration file, but can only be set to any |
1335 | 343 | @@ -2248,6 +2249,8 @@ | 343 | @@ -2252,6 +2253,8 @@ |
1336 | 344 | goto error; | 344 | goto error; |
1337 | 345 | } | 345 | } |
1338 | 346 | 346 | ||
1339 | @@ -349,7 +349,7 @@ | |||
1340 | 349 | srv_extra_undoslots = (ibool) innobase_extra_undoslots; | 349 | srv_extra_undoslots = (ibool) innobase_extra_undoslots; |
1341 | 350 | 350 | ||
1342 | 351 | srv_use_sys_stats_table = (ibool) innobase_use_sys_stats_table; | 351 | srv_use_sys_stats_table = (ibool) innobase_use_sys_stats_table; |
1344 | 352 | @@ -11321,6 +11324,11 @@ | 352 | @@ -11325,6 +11328,11 @@ |
1345 | 353 | "Path to individual files and their sizes.", | 353 | "Path to individual files and their sizes.", |
1346 | 354 | NULL, NULL, NULL); | 354 | NULL, NULL, NULL); |
1347 | 355 | 355 | ||
1348 | @@ -361,7 +361,7 @@ | |||
1349 | 361 | static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode, | 361 | static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode, |
1350 | 362 | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, | 362 | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, |
1351 | 363 | "The AUTOINC lock modes supported by InnoDB: " | 363 | "The AUTOINC lock modes supported by InnoDB: " |
1353 | 364 | @@ -11487,6 +11495,7 @@ | 364 | @@ -11506,6 +11514,7 @@ |
1354 | 365 | MYSQL_SYSVAR(commit_concurrency), | 365 | MYSQL_SYSVAR(commit_concurrency), |
1355 | 366 | MYSQL_SYSVAR(concurrency_tickets), | 366 | MYSQL_SYSVAR(concurrency_tickets), |
1356 | 367 | MYSQL_SYSVAR(data_file_path), | 367 | MYSQL_SYSVAR(data_file_path), |
1357 | 368 | 368 | ||
1358 | === modified file 'innodb_show_sys_tables.patch' | |||
1359 | --- innodb_show_sys_tables.patch 2010-12-16 11:35:26 +0000 | |||
1360 | +++ innodb_show_sys_tables.patch 2011-01-12 17:48:16 +0000 | |||
1361 | @@ -8,7 +8,7 @@ | |||
1362 | 8 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc | 8 | diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc |
1363 | 9 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:45:46.194411503 +0900 | 9 | --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:45:46.194411503 +0900 |
1364 | 10 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:49:26.171990559 +0900 | 10 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:49:26.171990559 +0900 |
1366 | 11 | @@ -11793,6 +11793,9 @@ | 11 | @@ -11814,6 +11814,9 @@ |
1367 | 12 | i_s_innodb_table_stats, | 12 | i_s_innodb_table_stats, |
1368 | 13 | i_s_innodb_index_stats, | 13 | i_s_innodb_index_stats, |
1369 | 14 | i_s_innodb_admin_command, | 14 | i_s_innodb_admin_command, |
1370 | @@ -29,13 +29,10 @@ | |||
1371 | 29 | #include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */ | 29 | #include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */ |
1372 | 30 | } | 30 | } |
1373 | 31 | 31 | ||
1381 | 32 | @@ -3112,6 +3113,664 @@ | 32 | @@ -3115,3 +3116,661 @@ |
1382 | 33 | STRUCT_FLD(deinit, i_s_common_deinit), | 33 | STRUCT_FLD(system_vars, NULL), |
1383 | 34 | STRUCT_FLD(version, 0x0100 /* 1.0 */), | 34 | STRUCT_FLD(__reserved1, NULL) |
1384 | 35 | STRUCT_FLD(status_vars, NULL), | 35 | }; |
1378 | 36 | + STRUCT_FLD(system_vars, NULL), | ||
1379 | 37 | + STRUCT_FLD(__reserved1, NULL) | ||
1380 | 38 | +}; | ||
1385 | 39 | + | 36 | + |
1386 | 40 | +static ST_FIELD_INFO i_s_innodb_sys_tables_info[] = | 37 | +static ST_FIELD_INFO i_s_innodb_sys_tables_info[] = |
1387 | 41 | +{ | 38 | +{ |
1388 | @@ -691,9 +688,9 @@ | |||
1389 | 691 | + STRUCT_FLD(deinit, i_s_common_deinit), | 688 | + STRUCT_FLD(deinit, i_s_common_deinit), |
1390 | 692 | + STRUCT_FLD(version, 0x0100 /* 1.0 */), | 689 | + STRUCT_FLD(version, 0x0100 /* 1.0 */), |
1391 | 693 | + STRUCT_FLD(status_vars, NULL), | 690 | + STRUCT_FLD(status_vars, NULL), |
1395 | 694 | STRUCT_FLD(system_vars, NULL), | 691 | + STRUCT_FLD(system_vars, NULL), |
1396 | 695 | STRUCT_FLD(__reserved1, NULL) | 692 | + STRUCT_FLD(__reserved1, NULL) |
1397 | 696 | }; | 693 | +}; |
1398 | 697 | diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/i_s.h | 694 | diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/i_s.h |
1399 | 698 | --- a/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:29:12.542982379 +0900 | 695 | --- a/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:29:12.542982379 +0900 |
1400 | 699 | +++ b/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:49:26.179990535 +0900 | 696 | +++ b/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:49:26.179990535 +0900 |
1401 | 700 | 697 | ||
1402 | === modified file 'profiling_slow.patch' | |||
1403 | --- profiling_slow.patch 2010-12-22 20:15:33 +0000 | |||
1404 | +++ profiling_slow.patch 2011-01-12 17:48:16 +0000 | |||
1405 | @@ -95,9 +95,9 @@ | |||
1406 | 95 | diff -ruN a/sql/log.cc b/sql/log.cc | 95 | diff -ruN a/sql/log.cc b/sql/log.cc |
1407 | 96 | --- a/sql/log.cc 2010-11-24 19:33:02.000000000 +0300 | 96 | --- a/sql/log.cc 2010-11-24 19:33:02.000000000 +0300 |
1408 | 97 | +++ b/sql/log.cc 2010-11-24 19:36:29.000000000 +0300 | 97 | +++ b/sql/log.cc 2010-11-24 19:36:29.000000000 +0300 |
1410 | 98 | @@ -2433,6 +2433,11 @@ | 98 | @@ -2434,6 +2434,11 @@ |
1411 | 99 | my_b_printf(&log_file,"# No InnoDB statistics available for this query\n") == (uint) -1) | 99 | my_b_printf(&log_file,"# No InnoDB statistics available for this query\n") == (uint) -1) |
1413 | 100 | tmp_errno=errno; | 100 | tmp_errno= errno; |
1414 | 101 | } | 101 | } |
1415 | 102 | + | 102 | + |
1416 | 103 | +#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) | 103 | +#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) |
1417 | 104 | 104 | ||
1418 | === modified file 'response-time-distribution.patch' | |||
1419 | --- response-time-distribution.patch 2010-12-22 20:15:33 +0000 | |||
1420 | +++ response-time-distribution.patch 2011-01-12 17:48:16 +0000 | |||
1421 | @@ -755,7 +755,7 @@ | |||
1422 | 755 | case SCH_COLLATION_CHARACTER_SET_APPLICABILITY: | 755 | case SCH_COLLATION_CHARACTER_SET_APPLICABILITY: |
1423 | 756 | case SCH_USER_PRIVILEGES: | 756 | case SCH_USER_PRIVILEGES: |
1424 | 757 | case SCH_SCHEMA_PRIVILEGES: | 757 | case SCH_SCHEMA_PRIVILEGES: |
1426 | 758 | @@ -7234,6 +7250,12 @@ | 758 | @@ -7235,6 +7251,12 @@ |
1427 | 759 | init_global_index_stats(); | 759 | init_global_index_stats(); |
1428 | 760 | pthread_mutex_unlock(&LOCK_global_index_stats); | 760 | pthread_mutex_unlock(&LOCK_global_index_stats); |
1429 | 761 | } | 761 | } |
1430 | 762 | 762 | ||
1431 | === modified file 'show_slave_status_nolock.patch' | |||
1432 | --- show_slave_status_nolock.patch 2010-12-17 19:06:49 +0000 | |||
1433 | +++ show_slave_status_nolock.patch 2011-01-12 17:48:16 +0000 | |||
1434 | @@ -61,7 +61,7 @@ | |||
1435 | 61 | sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND; | 61 | sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND; |
1436 | 62 | sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND; | 62 | sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND; |
1437 | 63 | sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]= CF_STATUS_COMMAND; | 63 | sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]= CF_STATUS_COMMAND; |
1439 | 64 | @@ -2545,12 +2546,16 @@ | 64 | @@ -2546,12 +2547,16 @@ |
1440 | 65 | pthread_mutex_unlock(&LOCK_active_mi); | 65 | pthread_mutex_unlock(&LOCK_active_mi); |
1441 | 66 | break; | 66 | break; |
1442 | 67 | } | 67 | } |
1443 | @@ -79,7 +79,7 @@ | |||
1444 | 79 | if (active_mi != NULL) | 79 | if (active_mi != NULL) |
1445 | 80 | { | 80 | { |
1446 | 81 | res = show_master_info(thd, active_mi); | 81 | res = show_master_info(thd, active_mi); |
1448 | 82 | @@ -2561,7 +2566,10 @@ | 82 | @@ -2562,7 +2567,10 @@ |
1449 | 83 | WARN_NO_MASTER_INFO, ER(WARN_NO_MASTER_INFO)); | 83 | WARN_NO_MASTER_INFO, ER(WARN_NO_MASTER_INFO)); |
1450 | 84 | my_ok(thd); | 84 | my_ok(thd); |
1451 | 85 | } | 85 | } |
1452 | 86 | 86 | ||
1453 | === modified file 'show_temp_51.patch' | |||
1454 | --- show_temp_51.patch 2010-12-16 11:35:26 +0000 | |||
1455 | +++ show_temp_51.patch 2011-01-12 17:48:16 +0000 | |||
1456 | @@ -50,7 +50,7 @@ | |||
1457 | 50 | case SCH_VIEWS: | 50 | case SCH_VIEWS: |
1458 | 51 | case SCH_TRIGGERS: | 51 | case SCH_TRIGGERS: |
1459 | 52 | case SCH_EVENTS: | 52 | case SCH_EVENTS: |
1461 | 53 | @@ -2317,6 +2322,7 @@ | 53 | @@ -2318,6 +2323,7 @@ |
1462 | 54 | } | 54 | } |
1463 | 55 | case SQLCOM_SHOW_DATABASES: | 55 | case SQLCOM_SHOW_DATABASES: |
1464 | 56 | case SQLCOM_SHOW_TABLES: | 56 | case SQLCOM_SHOW_TABLES: |
1465 | @@ -58,7 +58,7 @@ | |||
1466 | 58 | case SQLCOM_SHOW_TRIGGERS: | 58 | case SQLCOM_SHOW_TRIGGERS: |
1467 | 59 | case SQLCOM_SHOW_TABLE_STATUS: | 59 | case SQLCOM_SHOW_TABLE_STATUS: |
1468 | 60 | case SQLCOM_SHOW_OPEN_TABLES: | 60 | case SQLCOM_SHOW_OPEN_TABLES: |
1470 | 61 | @@ -5457,6 +5463,8 @@ | 61 | @@ -5458,6 +5464,8 @@ |
1471 | 62 | 62 | ||
1472 | 63 | case SCH_TABLE_NAMES: | 63 | case SCH_TABLE_NAMES: |
1473 | 64 | case SCH_TABLES: | 64 | case SCH_TABLES: |
1474 | 65 | 65 | ||
1475 | === modified file 'userstat.patch' | |||
1476 | --- userstat.patch 2011-01-04 11:30:51 +0000 | |||
1477 | +++ userstat.patch 2011-01-12 17:48:16 +0000 | |||
1478 | @@ -436,7 +436,7 @@ | |||
1479 | 436 | 436 | ||
1480 | 437 | /* | 437 | /* |
1481 | 438 | Log slow query with all enabled log event handlers | 438 | Log slow query with all enabled log event handlers |
1483 | 439 | @@ -4495,6 +4517,8 @@ | 439 | @@ -4496,6 +4518,8 @@ |
1484 | 440 | thd->first_successful_insert_id_in_prev_stmt_for_binlog); | 440 | thd->first_successful_insert_id_in_prev_stmt_for_binlog); |
1485 | 441 | if (e.write(file)) | 441 | if (e.write(file)) |
1486 | 442 | goto err; | 442 | goto err; |
1487 | @@ -445,7 +445,7 @@ | |||
1488 | 445 | } | 445 | } |
1489 | 446 | if (thd->auto_inc_intervals_in_cur_stmt_for_binlog.nb_elements() > 0) | 446 | if (thd->auto_inc_intervals_in_cur_stmt_for_binlog.nb_elements() > 0) |
1490 | 447 | { | 447 | { |
1492 | 448 | @@ -4506,12 +4530,16 @@ | 448 | @@ -4507,12 +4531,16 @@ |
1493 | 449 | minimum()); | 449 | minimum()); |
1494 | 450 | if (e.write(file)) | 450 | if (e.write(file)) |
1495 | 451 | goto err; | 451 | goto err; |
1496 | @@ -462,7 +462,7 @@ | |||
1497 | 462 | } | 462 | } |
1498 | 463 | if (thd->user_var_events.elements) | 463 | if (thd->user_var_events.elements) |
1499 | 464 | { | 464 | { |
1501 | 465 | @@ -4527,6 +4555,8 @@ | 465 | @@ -4528,6 +4556,8 @@ |
1502 | 466 | user_var_event->charset_number); | 466 | user_var_event->charset_number); |
1503 | 467 | if (e.write(file)) | 467 | if (e.write(file)) |
1504 | 468 | goto err; | 468 | goto err; |
1505 | @@ -471,7 +471,7 @@ | |||
1506 | 471 | } | 471 | } |
1507 | 472 | } | 472 | } |
1508 | 473 | } | 473 | } |
1510 | 474 | @@ -4539,6 +4569,8 @@ | 474 | @@ -4540,6 +4570,8 @@ |
1511 | 475 | if (event_info->write(file) || | 475 | if (event_info->write(file) || |
1512 | 476 | DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0)) | 476 | DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0)) |
1513 | 477 | goto err; | 477 | goto err; |
1514 | @@ -480,7 +480,7 @@ | |||
1515 | 480 | 480 | ||
1516 | 481 | if (file == &log_file) // we are writing to the real log (disk) | 481 | if (file == &log_file) // we are writing to the real log (disk) |
1517 | 482 | { | 482 | { |
1519 | 483 | @@ -4684,7 +4716,7 @@ | 483 | @@ -4685,7 +4717,7 @@ |
1520 | 484 | be reset as a READ_CACHE to be able to read the contents from it. | 484 | be reset as a READ_CACHE to be able to read the contents from it. |
1521 | 485 | */ | 485 | */ |
1522 | 486 | 486 | ||
1523 | @@ -489,7 +489,7 @@ | |||
1524 | 489 | { | 489 | { |
1525 | 490 | Mutex_sentry sentry(lock_log ? &LOCK_log : NULL); | 490 | Mutex_sentry sentry(lock_log ? &LOCK_log : NULL); |
1526 | 491 | 491 | ||
1528 | 492 | @@ -4732,6 +4764,7 @@ | 492 | @@ -4733,6 +4765,7 @@ |
1529 | 493 | /* write the first half of the split header */ | 493 | /* write the first half of the split header */ |
1530 | 494 | if (my_b_write(&log_file, header, carry)) | 494 | if (my_b_write(&log_file, header, carry)) |
1531 | 495 | return ER_ERROR_ON_WRITE; | 495 | return ER_ERROR_ON_WRITE; |
1532 | @@ -497,7 +497,7 @@ | |||
1533 | 497 | 497 | ||
1534 | 498 | /* | 498 | /* |
1535 | 499 | copy fixed second half of header to cache so the correct | 499 | copy fixed second half of header to cache so the correct |
1537 | 500 | @@ -4800,6 +4833,7 @@ | 500 | @@ -4801,6 +4834,7 @@ |
1538 | 501 | /* Write data to the binary log file */ | 501 | /* Write data to the binary log file */ |
1539 | 502 | if (my_b_write(&log_file, cache->read_pos, length)) | 502 | if (my_b_write(&log_file, cache->read_pos, length)) |
1540 | 503 | return ER_ERROR_ON_WRITE; | 503 | return ER_ERROR_ON_WRITE; |
1541 | @@ -505,7 +505,7 @@ | |||
1542 | 505 | cache->read_pos=cache->read_end; // Mark buffer used up | 505 | cache->read_pos=cache->read_end; // Mark buffer used up |
1543 | 506 | } while ((length= my_b_fill(cache))); | 506 | } while ((length= my_b_fill(cache))); |
1544 | 507 | 507 | ||
1546 | 508 | @@ -4922,21 +4956,24 @@ | 508 | @@ -4923,21 +4957,24 @@ |
1547 | 509 | */ | 509 | */ |
1548 | 510 | if (qinfo.write(&log_file)) | 510 | if (qinfo.write(&log_file)) |
1549 | 511 | goto err; | 511 | goto err; |
1550 | @@ -984,7 +984,7 @@ | |||
1551 | 984 | uint32 server_id; | 984 | uint32 server_id; |
1552 | 985 | uint32 file_id; // for LOAD DATA INFILE | 985 | uint32 file_id; // for LOAD DATA INFILE |
1553 | 986 | /* remote (peer) port */ | 986 | /* remote (peer) port */ |
1555 | 987 | @@ -1828,6 +1830,8 @@ | 987 | @@ -1833,6 +1835,8 @@ |
1556 | 988 | /* variables.transaction_isolation is reset to this after each commit */ | 988 | /* variables.transaction_isolation is reset to this after each commit */ |
1557 | 989 | enum_tx_isolation session_tx_isolation; | 989 | enum_tx_isolation session_tx_isolation; |
1558 | 990 | enum_check_fields count_cuted_fields; | 990 | enum_check_fields count_cuted_fields; |
1559 | @@ -993,7 +993,7 @@ | |||
1560 | 993 | 993 | ||
1561 | 994 | DYNAMIC_ARRAY user_var_events; /* For user variables replication */ | 994 | DYNAMIC_ARRAY user_var_events; /* For user variables replication */ |
1562 | 995 | MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */ | 995 | MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */ |
1564 | 996 | @@ -1916,6 +1920,49 @@ | 996 | @@ -1921,6 +1925,49 @@ |
1565 | 997 | */ | 997 | */ |
1566 | 998 | LOG_INFO* current_linfo; | 998 | LOG_INFO* current_linfo; |
1567 | 999 | NET* slave_net; // network connection from slave -> m. | 999 | NET* slave_net; // network connection from slave -> m. |
1568 | @@ -1043,7 +1043,7 @@ | |||
1569 | 1043 | /* Used by the sys_var class to store temporary values */ | 1043 | /* Used by the sys_var class to store temporary values */ |
1570 | 1044 | union | 1044 | union |
1571 | 1045 | { | 1045 | { |
1573 | 1046 | @@ -1981,6 +2028,11 @@ | 1046 | @@ -1986,6 +2033,11 @@ |
1574 | 1047 | alloc_root. | 1047 | alloc_root. |
1575 | 1048 | */ | 1048 | */ |
1576 | 1049 | void init_for_queries(); | 1049 | void init_for_queries(); |
1577 | @@ -1055,7 +1055,7 @@ | |||
1578 | 1055 | void change_user(void); | 1055 | void change_user(void); |
1579 | 1056 | void cleanup(void); | 1056 | void cleanup(void); |
1580 | 1057 | void cleanup_after_query(); | 1057 | void cleanup_after_query(); |
1582 | 1058 | @@ -2351,9 +2403,15 @@ | 1058 | @@ -2356,9 +2408,15 @@ |
1583 | 1059 | *p_db= strmake(db, db_length); | 1059 | *p_db= strmake(db, db_length); |
1584 | 1060 | *p_db_length= db_length; | 1060 | *p_db_length= db_length; |
1585 | 1061 | return FALSE; | 1061 | return FALSE; |
1586 | @@ -1071,7 +1071,7 @@ | |||
1587 | 1071 | public: | 1071 | public: |
1588 | 1072 | inline Internal_error_handler *get_internal_handler() | 1072 | inline Internal_error_handler *get_internal_handler() |
1589 | 1073 | { return m_internal_handler; } | 1073 | { return m_internal_handler; } |
1591 | 1074 | @@ -2437,6 +2495,9 @@ | 1074 | @@ -2442,6 +2500,9 @@ |
1592 | 1075 | LEX_STRING invoker_host; | 1075 | LEX_STRING invoker_host; |
1593 | 1076 | }; | 1076 | }; |
1594 | 1077 | 1077 | ||
1595 | @@ -1854,7 +1854,7 @@ | |||
1596 | 1854 | my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); | 1854 | my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); |
1597 | 1855 | DBUG_RETURN(TRUE); | 1855 | DBUG_RETURN(TRUE); |
1598 | 1856 | } | 1856 | } |
1600 | 1857 | @@ -5348,6 +5368,7 @@ | 1857 | @@ -5349,6 +5369,7 @@ |
1601 | 1858 | if (!no_errors) | 1858 | if (!no_errors) |
1602 | 1859 | { | 1859 | { |
1603 | 1860 | const char *db_name= db ? db : thd->db; | 1860 | const char *db_name= db ? db : thd->db; |
1604 | @@ -1862,7 +1862,7 @@ | |||
1605 | 1862 | my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), | 1862 | my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), |
1606 | 1863 | sctx->priv_user, sctx->priv_host, db_name); | 1863 | sctx->priv_user, sctx->priv_host, db_name); |
1607 | 1864 | } | 1864 | } |
1609 | 1865 | @@ -5380,12 +5401,15 @@ | 1865 | @@ -5381,12 +5402,15 @@ |
1610 | 1866 | { // We can never grant this | 1866 | { // We can never grant this |
1611 | 1867 | DBUG_PRINT("error",("No possible access")); | 1867 | DBUG_PRINT("error",("No possible access")); |
1612 | 1868 | if (!no_errors) | 1868 | if (!no_errors) |
1613 | @@ -1878,7 +1878,7 @@ | |||
1614 | 1878 | DBUG_RETURN(TRUE); /* purecov: tested */ | 1878 | DBUG_RETURN(TRUE); /* purecov: tested */ |
1615 | 1879 | } | 1879 | } |
1616 | 1880 | 1880 | ||
1618 | 1881 | @@ -5411,11 +5435,15 @@ | 1881 | @@ -5412,11 +5436,15 @@ |
1619 | 1882 | 1882 | ||
1620 | 1883 | DBUG_PRINT("error",("Access denied")); | 1883 | DBUG_PRINT("error",("Access denied")); |
1621 | 1884 | if (!no_errors) | 1884 | if (!no_errors) |
1622 | @@ -1894,7 +1894,7 @@ | |||
1623 | 1894 | DBUG_RETURN(TRUE); /* purecov: tested */ | 1894 | DBUG_RETURN(TRUE); /* purecov: tested */ |
1624 | 1895 | } | 1895 | } |
1625 | 1896 | 1896 | ||
1627 | 1897 | @@ -5444,6 +5472,7 @@ | 1897 | @@ -5445,6 +5473,7 @@ |
1628 | 1898 | 1898 | ||
1629 | 1899 | if (!thd->col_access && check_grant_db(thd, dst_db_name)) | 1899 | if (!thd->col_access && check_grant_db(thd, dst_db_name)) |
1630 | 1900 | { | 1900 | { |
1631 | @@ -1902,7 +1902,7 @@ | |||
1632 | 1902 | my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), | 1902 | my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), |
1633 | 1903 | thd->security_ctx->priv_user, | 1903 | thd->security_ctx->priv_user, |
1634 | 1904 | thd->security_ctx->priv_host, | 1904 | thd->security_ctx->priv_host, |
1636 | 1905 | @@ -5525,9 +5554,12 @@ | 1905 | @@ -5526,9 +5555,12 @@ |
1637 | 1906 | (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL))) | 1906 | (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL))) |
1638 | 1907 | { | 1907 | { |
1639 | 1908 | if (!no_errors) | 1908 | if (!no_errors) |
1640 | @@ -1915,7 +1915,7 @@ | |||
1641 | 1915 | return TRUE; | 1915 | return TRUE; |
1642 | 1916 | } | 1916 | } |
1643 | 1917 | /* | 1917 | /* |
1645 | 1918 | @@ -5690,6 +5722,7 @@ | 1918 | @@ -5691,6 +5723,7 @@ |
1646 | 1919 | if ((thd->security_ctx->master_access & want_access)) | 1919 | if ((thd->security_ctx->master_access & want_access)) |
1647 | 1920 | return 0; | 1920 | return 0; |
1648 | 1921 | get_privilege_desc(command, sizeof(command), want_access); | 1921 | get_privilege_desc(command, sizeof(command), want_access); |
1649 | @@ -1923,7 +1923,7 @@ | |||
1650 | 1923 | my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command); | 1923 | my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command); |
1651 | 1924 | return 1; | 1924 | return 1; |
1652 | 1925 | #else | 1925 | #else |
1654 | 1926 | @@ -6071,6 +6104,30 @@ | 1926 | @@ -6072,6 +6105,30 @@ |
1655 | 1927 | lex_start(thd); | 1927 | lex_start(thd); |
1656 | 1928 | mysql_reset_thd_for_next_command(thd); | 1928 | mysql_reset_thd_for_next_command(thd); |
1657 | 1929 | 1929 | ||
1658 | @@ -1954,7 +1954,7 @@ | |||
1659 | 1954 | if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0) | 1954 | if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0) |
1660 | 1955 | { | 1955 | { |
1661 | 1956 | LEX *lex= thd->lex; | 1956 | LEX *lex= thd->lex; |
1663 | 1957 | @@ -6151,6 +6208,43 @@ | 1957 | @@ -6152,6 +6209,43 @@ |
1664 | 1958 | *found_semicolon= NULL; | 1958 | *found_semicolon= NULL; |
1665 | 1959 | } | 1959 | } |
1666 | 1960 | 1960 | ||
1667 | @@ -1998,7 +1998,7 @@ | |||
1668 | 1998 | DBUG_VOID_RETURN; | 1998 | DBUG_VOID_RETURN; |
1669 | 1999 | } | 1999 | } |
1670 | 2000 | 2000 | ||
1672 | 2001 | @@ -7016,6 +7110,13 @@ | 2001 | @@ -7017,6 +7111,13 @@ |
1673 | 2002 | if (flush_error_log()) | 2002 | if (flush_error_log()) |
1674 | 2003 | result=1; | 2003 | result=1; |
1675 | 2004 | } | 2004 | } |
1676 | @@ -2012,7 +2012,7 @@ | |||
1677 | 2012 | #ifdef HAVE_QUERY_CACHE | 2012 | #ifdef HAVE_QUERY_CACHE |
1678 | 2013 | if (options & REFRESH_QUERY_CACHE_FREE) | 2013 | if (options & REFRESH_QUERY_CACHE_FREE) |
1679 | 2014 | { | 2014 | { |
1681 | 2015 | @@ -7116,6 +7217,40 @@ | 2015 | @@ -7117,6 +7218,40 @@ |
1682 | 2016 | #endif | 2016 | #endif |
1683 | 2017 | if (options & REFRESH_USER_RESOURCES) | 2017 | if (options & REFRESH_USER_RESOURCES) |
1684 | 2018 | reset_mqh((LEX_USER *) NULL, 0); /* purecov: inspected */ | 2018 | reset_mqh((LEX_USER *) NULL, 0); /* purecov: inspected */ |
The same should be made for 5.5