Merge lp:~sergei.glushchenko/percona-xtrabackup/2.1-xb-bug1222062 into lp:percona-xtrabackup/2.1
- 2.1-xb-bug1222062
- Merge into 2.1
Status: | Merged |
---|---|
Approved by: | Alexey Kopytov |
Approved revision: | no longer in the source branch. |
Merged at revision: | 764 |
Proposed branch: | lp:~sergei.glushchenko/percona-xtrabackup/2.1-xb-bug1222062 |
Merge into: | lp:percona-xtrabackup/2.1 |
Diff against target: |
631 lines (+109/-41) 13 files modified
doc/source/innobackupex/innobackupex_option_reference.rst (+4/-0) doc/source/xtrabackup_bin/xbk_option_reference.rst (+4/-0) innobackupex.pl (+11/-1) patches/innodb51.patch (+10/-8) patches/innodb55.patch (+9/-7) patches/innodb56.patch (+7/-5) patches/xtradb51.patch (+9/-7) patches/xtradb55.patch (+10/-8) src/fil_cur.cc (+1/-1) src/xtrabackup.cc (+14/-1) test/inc/common.sh (+4/-1) test/run.sh (+15/-2) test/t/bug1222062.sh (+11/-0) |
To merge this branch: | bzr merge lp:~sergei.glushchenko/percona-xtrabackup/2.1-xb-bug1222062 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Approve | ||
Review via email: mp+233639@code.launchpad.net |
Commit message
Description of the change
Bug 1222062: Add an option to disable opening all tablespaces on backup start
Introduce xtrabackup option --close-
handlers when they aren't needed anymore. Introduce new option -x
for run.sh to force xtrabackup options for all tests by putting them
into [xtrabackup] section of my.cnf.
Two jenkins runs with and without --close-
http://
http://
Alexey Kopytov (akopytov) wrote : | # |
In the warning text, I would also explain the consequences briefly, rather than refer users to a bug with a long discussion.
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Hi Alexey,
All comments are reasonable. I just want to explain why I haven't implement option for innobackupex. We don't recommend to use this option and normally user will not use it. However, if he need it badly, then he actually nows what he is doing. So there is an option for him to add it into my.cnf. Isn't it enough?
Alexey Kopytov (akopytov) wrote : | # |
Sure, but what if a user hits the open files limit, but still wants to create full backups with mysql.* and other MyISAM tables, buffer pool dumps, etc.?
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
He can put the option into [xtrabackup] of my.cnf, it will work file. Anyways I already added the corresponding innobackupex option.
Alexey Kopytov (akopytov) wrote : | # |
I'd be very cautious to put such an option to my.cnf. It's too easy to forget and replicate it to another server, for example. Anyway, now the users are free to choose how they want to use it. Thanks.
Preview Diff
1 | === modified file 'doc/source/innobackupex/innobackupex_option_reference.rst' | |||
2 | --- doc/source/innobackupex/innobackupex_option_reference.rst 2014-05-18 08:23:31 +0000 | |||
3 | +++ doc/source/innobackupex/innobackupex_option_reference.rst 2014-09-10 11:23:06 +0000 | |||
4 | @@ -14,6 +14,10 @@ | |||
5 | 14 | 14 | ||
6 | 15 | Prepare a backup in ``BACKUP-DIR`` by applying the transaction log file named :file:`xtrabackup_logfile` located in the same directory. Also, create new transaction logs. The InnoDB configuration is read from the file :file:`backup-my.cnf` created by |innobackupex| when the backup was made. innobackupex --apply-log uses InnoDB configuration from ``backup-my.cnf`` by default, or from --defaults-file, if specified. InnoDB configuration in this context means server variables that affect data format, i.e. :option:`innodb_page_size`, :option:`innodb_log_block_size`, etc. Location-related variables, like :option:`innodb_log_group_home_dir` or :option:`innodb_data_file_path` are always ignored by --apply-log, so preparing a backup always works with data files from the backup directory, rather than any external ones. | 15 | Prepare a backup in ``BACKUP-DIR`` by applying the transaction log file named :file:`xtrabackup_logfile` located in the same directory. Also, create new transaction logs. The InnoDB configuration is read from the file :file:`backup-my.cnf` created by |innobackupex| when the backup was made. innobackupex --apply-log uses InnoDB configuration from ``backup-my.cnf`` by default, or from --defaults-file, if specified. InnoDB configuration in this context means server variables that affect data format, i.e. :option:`innodb_page_size`, :option:`innodb_log_block_size`, etc. Location-related variables, like :option:`innodb_log_group_home_dir` or :option:`innodb_data_file_path` are always ignored by --apply-log, so preparing a backup always works with data files from the backup directory, rather than any external ones. |
7 | 16 | 16 | ||
8 | 17 | .. option:: --close-files | ||
9 | 18 | |||
10 | 19 | Do not keep files opened. This option is passed directly to xtrabackup. When xtrabackup opens tablespace it normally doesn't close its file handle in order to handle the DDL operations correctly. However, if the number of tablespaces is really huge and can not fit into any limit, there is an option to close file handles once they are no longer accessed. Xtrabackup can produce inconsistent backups with this option enabled. Use at your own risk. | ||
11 | 20 | |||
12 | 17 | .. option:: --compact | 21 | .. option:: --compact |
13 | 18 | 22 | ||
14 | 19 | Create a compact backup with all secondary index pages omitted. This option is passed directly to xtrabackup. See the :program:`xtrabackup` :doc:`documentation <../xtrabackup_bin/xtrabackup_binary>` for details. | 23 | Create a compact backup with all secondary index pages omitted. This option is passed directly to xtrabackup. See the :program:`xtrabackup` :doc:`documentation <../xtrabackup_bin/xtrabackup_binary>` for details. |
15 | 20 | 24 | ||
16 | === modified file 'doc/source/xtrabackup_bin/xbk_option_reference.rst' | |||
17 | --- doc/source/xtrabackup_bin/xbk_option_reference.rst 2014-05-18 08:23:31 +0000 | |||
18 | +++ doc/source/xtrabackup_bin/xbk_option_reference.rst 2014-09-10 11:23:06 +0000 | |||
19 | @@ -17,6 +17,10 @@ | |||
20 | 17 | 17 | ||
21 | 18 | Make a backup and place it in :option:`--target-dir`. See :doc:`Creating a backup <creating_a_backup>`. | 18 | Make a backup and place it in :option:`--target-dir`. See :doc:`Creating a backup <creating_a_backup>`. |
22 | 19 | 19 | ||
23 | 20 | .. option:: --close-files | ||
24 | 21 | |||
25 | 22 | Do not keep files opened. When xtrabackup opens tablespace it normally doesn't close its file handle in order to handle the DDL operations correctly. However, if the number of tablespaces is really huge and can not fit into any limit, there is an option to close file handles once they are no longer accessed. Xtrabackup can produce inconsistent backups with this option enabled. Use at your own risk. | ||
26 | 23 | |||
27 | 20 | .. option:: --compact | 24 | .. option:: --compact |
28 | 21 | 25 | ||
29 | 22 | Create a compact backup by skipping secondary index pages. | 26 | Create a compact backup by skipping secondary index pages. |
30 | 23 | 27 | ||
31 | === modified file 'innobackupex.pl' | |||
32 | --- innobackupex.pl 2014-09-02 14:54:11 +0000 | |||
33 | +++ innobackupex.pl 2014-09-10 11:23:06 +0000 | |||
34 | @@ -135,6 +135,7 @@ | |||
35 | 135 | my $option_safe_slave_backup = ''; | 135 | my $option_safe_slave_backup = ''; |
36 | 136 | my $option_safe_slave_backup_timeout = 300; | 136 | my $option_safe_slave_backup_timeout = 300; |
37 | 137 | 137 | ||
38 | 138 | my $option_close_files = ''; | ||
39 | 138 | my $option_compact = ''; | 139 | my $option_compact = ''; |
40 | 139 | my $option_rebuild_indexes = ''; | 140 | my $option_rebuild_indexes = ''; |
41 | 140 | my $option_rebuild_threads = 0; | 141 | my $option_rebuild_threads = 0; |
42 | @@ -2802,6 +2803,10 @@ | |||
43 | 2802 | $options = $options . " --stream=$option_stream"; | 2803 | $options = $options . " --stream=$option_stream"; |
44 | 2803 | } | 2804 | } |
45 | 2804 | 2805 | ||
46 | 2806 | if ($option_close_files) { | ||
47 | 2807 | $options = $options . " --close-files"; | ||
48 | 2808 | } | ||
49 | 2809 | |||
50 | 2805 | if ($option_compact) { | 2810 | if ($option_compact) { |
51 | 2806 | $options = $options . " --compact"; | 2811 | $options = $options . " --compact"; |
52 | 2807 | } | 2812 | } |
53 | @@ -3664,6 +3669,7 @@ | |||
54 | 3664 | 'parallel=i' => \$option_parallel, | 3669 | 'parallel=i' => \$option_parallel, |
55 | 3665 | 'safe-slave-backup' => \$option_safe_slave_backup, | 3670 | 'safe-slave-backup' => \$option_safe_slave_backup, |
56 | 3666 | 'safe-slave-backup-timeout=i' => \$option_safe_slave_backup_timeout, | 3671 | 'safe-slave-backup-timeout=i' => \$option_safe_slave_backup_timeout, |
57 | 3672 | 'close-files' => \$option_close_files, | ||
58 | 3667 | 'compact' => \$option_compact, | 3673 | 'compact' => \$option_compact, |
59 | 3668 | 'rebuild-indexes' => \$option_rebuild_indexes, | 3674 | 'rebuild-indexes' => \$option_rebuild_indexes, |
60 | 3669 | 'rebuild-threads=i' => \$option_rebuild_threads, | 3675 | 'rebuild-threads=i' => \$option_rebuild_threads, |
61 | @@ -4802,7 +4808,7 @@ | |||
62 | 4802 | [--tmpdir=DIRECTORY] [--tables-file=FILE] | 4808 | [--tmpdir=DIRECTORY] [--tables-file=FILE] |
63 | 4803 | [--incremental] [--incremental-basedir] | 4809 | [--incremental] [--incremental-basedir] |
64 | 4804 | [--incremental-dir] [--incremental-force-scan] [--incremental-lsn] | 4810 | [--incremental-dir] [--incremental-force-scan] [--incremental-lsn] |
66 | 4805 | [--compact] | 4811 | [--close-files] [--compact] |
67 | 4806 | BACKUP-ROOT-DIR | 4812 | BACKUP-ROOT-DIR |
68 | 4807 | 4813 | ||
69 | 4808 | innobackupex --apply-log [--use-memory=B] | 4814 | innobackupex --apply-log [--use-memory=B] |
70 | @@ -4874,6 +4880,10 @@ | |||
71 | 4874 | 4880 | ||
72 | 4875 | Prepare a backup in BACKUP-DIR by applying the transaction log file named "xtrabackup_logfile" located in the same directory. Also, create new transaction logs. The InnoDB configuration is read from the file "backup-my.cnf". | 4881 | Prepare a backup in BACKUP-DIR by applying the transaction log file named "xtrabackup_logfile" located in the same directory. Also, create new transaction logs. The InnoDB configuration is read from the file "backup-my.cnf". |
73 | 4876 | 4882 | ||
74 | 4883 | =item --close-files | ||
75 | 4884 | |||
76 | 4885 | Do not keep files opened. This option is passed directly to xtrabackup. Use at your own risk. | ||
77 | 4886 | |||
78 | 4877 | =item --compact | 4887 | =item --compact |
79 | 4878 | 4888 | ||
80 | 4879 | Create a compact backup with all secondary index pages omitted. This option is passed directly to xtrabackup. See xtrabackup documentation for details. | 4889 | Create a compact backup with all secondary index pages omitted. This option is passed directly to xtrabackup. See xtrabackup documentation for details. |
81 | 4880 | 4890 | ||
82 | === modified file 'patches/innodb51.patch' | |||
83 | --- patches/innodb51.patch 2014-02-23 01:28:49 +0000 | |||
84 | +++ patches/innodb51.patch 2014-09-10 11:23:06 +0000 | |||
85 | @@ -288,7 +288,7 @@ | |||
86 | 288 | } | 288 | } |
87 | 289 | 289 | ||
88 | 290 | fil_system->max_assigned_id = id; | 290 | fil_system->max_assigned_id = id; |
90 | 291 | @@ -1438,7 +1488,12 @@ | 291 | @@ -1438,7 +1448,12 @@ |
91 | 292 | the file yet; the following calls will open it and update the | 292 | the file yet; the following calls will open it and update the |
92 | 293 | size fields */ | 293 | size fields */ |
93 | 294 | 294 | ||
94 | @@ -487,7 +487,7 @@ | |||
95 | 487 | + inconsistencies between the file name and the actual tablespace contents | 487 | + inconsistencies between the file name and the actual tablespace contents |
96 | 488 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and | 488 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and |
97 | 489 | + the actual copy operation. */ | 489 | + the actual copy operation. */ |
99 | 490 | + if (srv_backup_mode) { | 490 | + if (srv_backup_mode && !srv_close_files) { |
100 | 491 | + | 491 | + |
101 | 492 | + fil_node_t* node; | 492 | + fil_node_t* node; |
102 | 493 | + fil_space_t* space; | 493 | + fil_space_t* space; |
103 | @@ -723,7 +723,7 @@ | |||
104 | 723 | || ibuf_page(space_id, zip_size, block_offset, NULL)); | 723 | || ibuf_page(space_id, zip_size, block_offset, NULL)); |
105 | 724 | # endif /* UNIV_LOG_DEBUG */ | 724 | # endif /* UNIV_LOG_DEBUG */ |
106 | 725 | if (sync) { | 725 | if (sync) { |
108 | 726 | @@ -4361,6 +4697,16 @@ | 726 | @@ -4361,6 +4597,16 @@ |
109 | 727 | 727 | ||
110 | 728 | ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE)); | 728 | ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE)); |
111 | 729 | 729 | ||
112 | @@ -817,7 +817,7 @@ | |||
113 | 817 | 817 | ||
114 | 818 | --- a/storage/innodb_plugin/include/srv0srv.h | 818 | --- a/storage/innodb_plugin/include/srv0srv.h |
115 | 819 | +++ b/storage/innodb_plugin/include/srv0srv.h | 819 | +++ b/storage/innodb_plugin/include/srv0srv.h |
117 | 820 | @@ -202,6 +202,11 @@ | 820 | @@ -202,6 +202,12 @@ |
118 | 821 | extern ulong srv_max_purge_lag; | 821 | extern ulong srv_max_purge_lag; |
119 | 822 | 822 | ||
120 | 823 | extern ulong srv_replication_delay; | 823 | extern ulong srv_replication_delay; |
121 | @@ -826,6 +826,7 @@ | |||
122 | 826 | +extern ibool srv_fake_write; | 826 | +extern ibool srv_fake_write; |
123 | 827 | +extern ibool srv_apply_log_only; | 827 | +extern ibool srv_apply_log_only; |
124 | 828 | +extern ibool srv_backup_mode; | 828 | +extern ibool srv_backup_mode; |
125 | 829 | +extern ibool srv_close_files; | ||
126 | 829 | /*-------------------------------------------*/ | 830 | /*-------------------------------------------*/ |
127 | 830 | 831 | ||
128 | 831 | extern ulint srv_n_rows_inserted; | 832 | extern ulint srv_n_rows_inserted; |
129 | @@ -1217,7 +1218,7 @@ | |||
130 | 1217 | 1218 | ||
131 | 1218 | --- a/storage/innodb_plugin/srv/srv0srv.c | 1219 | --- a/storage/innodb_plugin/srv/srv0srv.c |
132 | 1219 | +++ b/storage/innodb_plugin/srv/srv0srv.c | 1220 | +++ b/storage/innodb_plugin/srv/srv0srv.c |
134 | 1220 | @@ -383,6 +383,10 @@ | 1221 | @@ -383,6 +383,11 @@ |
135 | 1221 | 1222 | ||
136 | 1222 | UNIV_INTERN ulong srv_replication_delay = 0; | 1223 | UNIV_INTERN ulong srv_replication_delay = 0; |
137 | 1223 | 1224 | ||
138 | @@ -1225,10 +1226,11 @@ | |||
139 | 1225 | +UNIV_INTERN ibool srv_fake_write = FALSE; | 1226 | +UNIV_INTERN ibool srv_fake_write = FALSE; |
140 | 1226 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; | 1227 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; |
141 | 1227 | +UNIV_INTERN ibool srv_backup_mode = FALSE; | 1228 | +UNIV_INTERN ibool srv_backup_mode = FALSE; |
142 | 1229 | +UNIV_INTERN ibool srv_close_files = FALSE; | ||
143 | 1228 | /*-------------------------------------------*/ | 1230 | /*-------------------------------------------*/ |
144 | 1229 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; | 1231 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; |
145 | 1230 | UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; | 1232 | UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; |
147 | 1231 | @@ -1011,7 +1015,7 @@ | 1233 | @@ -1011,7 +1016,7 @@ |
148 | 1232 | } | 1234 | } |
149 | 1233 | 1235 | ||
150 | 1234 | /* Initialize some INFORMATION SCHEMA internal structures */ | 1236 | /* Initialize some INFORMATION SCHEMA internal structures */ |
151 | @@ -1237,7 +1239,7 @@ | |||
152 | 1237 | } | 1239 | } |
153 | 1238 | 1240 | ||
154 | 1239 | /*********************************************************************//** | 1241 | /*********************************************************************//** |
156 | 1240 | @@ -1022,6 +1026,7 @@ | 1242 | @@ -1022,6 +1027,7 @@ |
157 | 1241 | /*==========*/ | 1243 | /*==========*/ |
158 | 1242 | { | 1244 | { |
159 | 1243 | os_fast_mutex_free(&srv_conc_mutex); | 1245 | os_fast_mutex_free(&srv_conc_mutex); |
160 | @@ -1245,7 +1247,7 @@ | |||
161 | 1245 | mem_free(srv_conc_slots); | 1247 | mem_free(srv_conc_slots); |
162 | 1246 | srv_conc_slots = NULL; | 1248 | srv_conc_slots = NULL; |
163 | 1247 | 1249 | ||
165 | 1248 | @@ -1035,6 +1040,7 @@ | 1250 | @@ -1035,6 +1041,7 @@ |
166 | 1249 | srv_mysql_table = NULL; | 1251 | srv_mysql_table = NULL; |
167 | 1250 | 1252 | ||
168 | 1251 | trx_i_s_cache_free(trx_i_s_cache); | 1253 | trx_i_s_cache_free(trx_i_s_cache); |
169 | 1252 | 1254 | ||
170 | === modified file 'patches/innodb55.patch' | |||
171 | --- patches/innodb55.patch 2014-02-23 01:28:49 +0000 | |||
172 | +++ patches/innodb55.patch 2014-09-10 11:23:06 +0000 | |||
173 | @@ -487,7 +487,7 @@ | |||
174 | 487 | + inconsistencies between the file name and the actual tablespace contents | 487 | + inconsistencies between the file name and the actual tablespace contents |
175 | 488 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and | 488 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and |
176 | 489 | + the actual copy operation. */ | 489 | + the actual copy operation. */ |
178 | 490 | + if (srv_backup_mode) { | 490 | + if (srv_backup_mode && !srv_close_files) { |
179 | 491 | + | 491 | + |
180 | 492 | + fil_node_t* node; | 492 | + fil_node_t* node; |
181 | 493 | + fil_space_t* space; | 493 | + fil_space_t* space; |
182 | @@ -784,7 +784,7 @@ | |||
183 | 784 | Returns TRUE if a single-table tablespace does not exist in the memory cache, | 784 | Returns TRUE if a single-table tablespace does not exist in the memory cache, |
184 | 785 | --- a/storage/innobase/include/srv0srv.h | 785 | --- a/storage/innobase/include/srv0srv.h |
185 | 786 | +++ b/storage/innobase/include/srv0srv.h | 786 | +++ b/storage/innobase/include/srv0srv.h |
187 | 787 | @@ -218,6 +218,11 @@ | 787 | @@ -218,6 +218,12 @@ |
188 | 788 | extern ulong srv_max_purge_lag; | 788 | extern ulong srv_max_purge_lag; |
189 | 789 | 789 | ||
190 | 790 | extern ulong srv_replication_delay; | 790 | extern ulong srv_replication_delay; |
191 | @@ -793,6 +793,7 @@ | |||
192 | 793 | +extern ibool srv_fake_write; | 793 | +extern ibool srv_fake_write; |
193 | 794 | +extern ibool srv_apply_log_only; | 794 | +extern ibool srv_apply_log_only; |
194 | 795 | +extern ibool srv_backup_mode; | 795 | +extern ibool srv_backup_mode; |
195 | 796 | +extern ibool srv_close_files; | ||
196 | 796 | /*-------------------------------------------*/ | 797 | /*-------------------------------------------*/ |
197 | 797 | 798 | ||
198 | 798 | extern ulint srv_n_rows_inserted; | 799 | extern ulint srv_n_rows_inserted; |
199 | @@ -1139,7 +1140,7 @@ | |||
200 | 1139 | } | 1140 | } |
201 | 1140 | --- a/storage/innobase/srv/srv0srv.c | 1141 | --- a/storage/innobase/srv/srv0srv.c |
202 | 1141 | +++ b/storage/innobase/srv/srv0srv.c | 1142 | +++ b/storage/innobase/srv/srv0srv.c |
204 | 1142 | @@ -405,6 +405,10 @@ | 1143 | @@ -405,6 +405,11 @@ |
205 | 1143 | 1144 | ||
206 | 1144 | UNIV_INTERN ulong srv_replication_delay = 0; | 1145 | UNIV_INTERN ulong srv_replication_delay = 0; |
207 | 1145 | 1146 | ||
208 | @@ -1147,10 +1148,11 @@ | |||
209 | 1147 | +UNIV_INTERN ibool srv_fake_write = FALSE; | 1148 | +UNIV_INTERN ibool srv_fake_write = FALSE; |
210 | 1148 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; | 1149 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; |
211 | 1149 | +UNIV_INTERN ibool srv_backup_mode = FALSE; | 1150 | +UNIV_INTERN ibool srv_backup_mode = FALSE; |
212 | 1151 | +UNIV_INTERN ibool srv_close_files = FALSE; | ||
213 | 1150 | /*-------------------------------------------*/ | 1152 | /*-------------------------------------------*/ |
214 | 1151 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; | 1153 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; |
215 | 1152 | UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; | 1154 | UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; |
217 | 1153 | @@ -1084,7 +1088,7 @@ | 1155 | @@ -1084,7 +1089,7 @@ |
218 | 1154 | } | 1156 | } |
219 | 1155 | 1157 | ||
220 | 1156 | /* Initialize some INFORMATION SCHEMA internal structures */ | 1158 | /* Initialize some INFORMATION SCHEMA internal structures */ |
221 | @@ -1159,7 +1161,7 @@ | |||
222 | 1159 | } | 1161 | } |
223 | 1160 | 1162 | ||
224 | 1161 | /*********************************************************************//** | 1163 | /*********************************************************************//** |
226 | 1162 | @@ -1095,6 +1099,7 @@ | 1164 | @@ -1095,6 +1100,7 @@ |
227 | 1163 | /*==========*/ | 1165 | /*==========*/ |
228 | 1164 | { | 1166 | { |
229 | 1165 | os_fast_mutex_free(&srv_conc_mutex); | 1167 | os_fast_mutex_free(&srv_conc_mutex); |
230 | @@ -1167,7 +1169,7 @@ | |||
231 | 1167 | mem_free(srv_conc_slots); | 1169 | mem_free(srv_conc_slots); |
232 | 1168 | srv_conc_slots = NULL; | 1170 | srv_conc_slots = NULL; |
233 | 1169 | 1171 | ||
235 | 1170 | @@ -1108,6 +1113,7 @@ | 1172 | @@ -1108,6 +1114,7 @@ |
236 | 1171 | srv_mysql_table = NULL; | 1173 | srv_mysql_table = NULL; |
237 | 1172 | 1174 | ||
238 | 1173 | trx_i_s_cache_free(trx_i_s_cache); | 1175 | trx_i_s_cache_free(trx_i_s_cache); |
239 | @@ -1175,7 +1177,7 @@ | |||
240 | 1175 | } | 1177 | } |
241 | 1176 | 1178 | ||
242 | 1177 | /*********************************************************************//** | 1179 | /*********************************************************************//** |
244 | 1178 | @@ -1728,7 +1734,7 @@ | 1180 | @@ -1728,7 +1735,7 @@ |
245 | 1179 | } | 1181 | } |
246 | 1180 | 1182 | ||
247 | 1181 | /* Record the lock wait time for this thread */ | 1183 | /* Record the lock wait time for this thread */ |
248 | 1182 | 1184 | ||
249 | === modified file 'patches/innodb56.patch' | |||
250 | --- patches/innodb56.patch 2014-08-17 09:44:20 +0000 | |||
251 | +++ patches/innodb56.patch 2014-09-10 11:23:06 +0000 | |||
252 | @@ -567,7 +567,7 @@ | |||
253 | 567 | + inconsistencies between the file name and the actual tablespace contents | 567 | + inconsistencies between the file name and the actual tablespace contents |
254 | 568 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and | 568 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and |
255 | 569 | + the actual copy operation. */ | 569 | + the actual copy operation. */ |
257 | 570 | + if (srv_backup_mode) { | 570 | + if (srv_backup_mode && !srv_close_files) { |
258 | 571 | + | 571 | + |
259 | 572 | + fil_node_t* node; | 572 | + fil_node_t* node; |
260 | 573 | + fil_space_t* space; | 573 | + fil_space_t* space; |
261 | @@ -1261,7 +1261,7 @@ | |||
262 | 1261 | extern mysql_pfs_key_t innodb_file_data_key; | 1261 | extern mysql_pfs_key_t innodb_file_data_key; |
263 | 1262 | --- a/storage/innobase/include/srv0srv.h | 1262 | --- a/storage/innobase/include/srv0srv.h |
264 | 1263 | +++ b/storage/innobase/include/srv0srv.h | 1263 | +++ b/storage/innobase/include/srv0srv.h |
266 | 1264 | @@ -353,6 +353,13 @@ | 1264 | @@ -353,6 +353,14 @@ |
267 | 1265 | extern ulong srv_max_purge_lag_delay; | 1265 | extern ulong srv_max_purge_lag_delay; |
268 | 1266 | 1266 | ||
269 | 1267 | extern ulong srv_replication_delay; | 1267 | extern ulong srv_replication_delay; |
270 | @@ -1271,11 +1271,12 @@ | |||
271 | 1271 | +extern ibool srv_apply_log_only; | 1271 | +extern ibool srv_apply_log_only; |
272 | 1272 | + | 1272 | + |
273 | 1273 | +extern ibool srv_backup_mode; | 1273 | +extern ibool srv_backup_mode; |
274 | 1274 | +extern ibool srv_close_files; | ||
275 | 1274 | + | 1275 | + |
276 | 1275 | /*-------------------------------------------*/ | 1276 | /*-------------------------------------------*/ |
277 | 1276 | 1277 | ||
278 | 1277 | extern my_bool srv_print_innodb_monitor; | 1278 | extern my_bool srv_print_innodb_monitor; |
280 | 1278 | @@ -496,13 +503,17 @@ | 1279 | @@ -496,13 +504,17 @@ |
281 | 1279 | the reason for which is that some FS | 1280 | the reason for which is that some FS |
282 | 1280 | do not flush meta-data when | 1281 | do not flush meta-data when |
283 | 1281 | unbuffered IO happens */ | 1282 | unbuffered IO happens */ |
284 | @@ -2259,13 +2260,14 @@ | |||
285 | 2259 | /* User settable value of the number of pages that must be present | 2260 | /* User settable value of the number of pages that must be present |
286 | 2260 | in the buffer cache and accessed sequentially for InnoDB to trigger a | 2261 | in the buffer cache and accessed sequentially for InnoDB to trigger a |
287 | 2261 | readahead request. */ | 2262 | readahead request. */ |
289 | 2262 | @@ -349,6 +353,13 @@ | 2263 | @@ -349,6 +353,14 @@ |
290 | 2263 | 2264 | ||
291 | 2264 | UNIV_INTERN ulong srv_replication_delay = 0; | 2265 | UNIV_INTERN ulong srv_replication_delay = 0; |
292 | 2265 | 2266 | ||
293 | 2266 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; | 2267 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; |
294 | 2267 | + | 2268 | + |
295 | 2268 | +UNIV_INTERN ibool srv_backup_mode = FALSE; | 2269 | +UNIV_INTERN ibool srv_backup_mode = FALSE; |
296 | 2270 | +UNIV_INTERN ibool srv_close_files = TRUE; | ||
297 | 2269 | + | 2271 | + |
298 | 2270 | +UNIV_INTERN ulint srv_log_checksum_algorithm = | 2272 | +UNIV_INTERN ulint srv_log_checksum_algorithm = |
299 | 2271 | + SRV_CHECKSUM_ALGORITHM_INNODB; | 2273 | + SRV_CHECKSUM_ALGORITHM_INNODB; |
300 | @@ -2273,7 +2275,7 @@ | |||
301 | 2273 | /*-------------------------------------------*/ | 2275 | /*-------------------------------------------*/ |
302 | 2274 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; | 2276 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; |
303 | 2275 | UNIV_INTERN ulong srv_spin_wait_delay = 6; | 2277 | UNIV_INTERN ulong srv_spin_wait_delay = 6; |
305 | 2276 | @@ -1818,7 +1829,8 @@ | 2278 | @@ -1818,7 +1830,8 @@ |
306 | 2277 | if (ret == SRV_NONE | 2279 | if (ret == SRV_NONE |
307 | 2278 | && srv_shutdown_state != SRV_SHUTDOWN_NONE | 2280 | && srv_shutdown_state != SRV_SHUTDOWN_NONE |
308 | 2279 | && trx_purge_state() != PURGE_STATE_DISABLED | 2281 | && trx_purge_state() != PURGE_STATE_DISABLED |
309 | 2280 | 2282 | ||
310 | === modified file 'patches/xtradb51.patch' | |||
311 | --- patches/xtradb51.patch 2014-02-23 01:28:49 +0000 | |||
312 | +++ patches/xtradb51.patch 2014-09-10 11:23:06 +0000 | |||
313 | @@ -380,7 +380,7 @@ | |||
314 | 380 | + inconsistencies between the file name and the actual tablespace contents | 380 | + inconsistencies between the file name and the actual tablespace contents |
315 | 381 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and | 381 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and |
316 | 382 | + the actual copy operation. */ | 382 | + the actual copy operation. */ |
318 | 383 | + if (srv_backup_mode) { | 383 | + if (srv_backup_mode && !srv_close_files) { |
319 | 384 | + | 384 | + |
320 | 385 | + fil_node_t* node; | 385 | + fil_node_t* node; |
321 | 386 | + fil_space_t* space; | 386 | + fil_space_t* space; |
322 | @@ -763,7 +763,7 @@ | |||
323 | 763 | return(buf); | 763 | return(buf); |
324 | 764 | --- a/storage/innodb_plugin/include/srv0srv.h | 764 | --- a/storage/innodb_plugin/include/srv0srv.h |
325 | 765 | +++ b/storage/innodb_plugin/include/srv0srv.h | 765 | +++ b/storage/innodb_plugin/include/srv0srv.h |
327 | 766 | @@ -243,6 +243,11 @@ | 766 | @@ -243,6 +243,12 @@ |
328 | 767 | 767 | ||
329 | 768 | extern ulong srv_replication_delay; | 768 | extern ulong srv_replication_delay; |
330 | 769 | 769 | ||
331 | @@ -771,6 +771,7 @@ | |||
332 | 771 | +extern ibool srv_fake_write; | 771 | +extern ibool srv_fake_write; |
333 | 772 | +extern ibool srv_apply_log_only; | 772 | +extern ibool srv_apply_log_only; |
334 | 773 | +extern ibool srv_backup_mode; | 773 | +extern ibool srv_backup_mode; |
335 | 774 | +extern ibool srv_close_files; | ||
336 | 774 | + | 775 | + |
337 | 775 | extern long long srv_ibuf_max_size; | 776 | extern long long srv_ibuf_max_size; |
338 | 776 | extern ulint srv_ibuf_active_contract; | 777 | extern ulint srv_ibuf_active_contract; |
339 | @@ -1140,7 +1141,7 @@ | |||
340 | 1140 | /* prototypes for new functions added to ha_innodb.cc */ | 1141 | /* prototypes for new functions added to ha_innodb.cc */ |
341 | 1141 | ibool innobase_get_slow_log(); | 1142 | ibool innobase_get_slow_log(); |
342 | 1142 | 1143 | ||
344 | 1143 | @@ -438,6 +433,11 @@ | 1144 | @@ -438,6 +433,12 @@ |
345 | 1144 | 1145 | ||
346 | 1145 | UNIV_INTERN ulong srv_replication_delay = 0; | 1146 | UNIV_INTERN ulong srv_replication_delay = 0; |
347 | 1146 | 1147 | ||
348 | @@ -1148,11 +1149,12 @@ | |||
349 | 1148 | +UNIV_INTERN ibool srv_fake_write = FALSE; | 1149 | +UNIV_INTERN ibool srv_fake_write = FALSE; |
350 | 1149 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; | 1150 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; |
351 | 1150 | +UNIV_INTERN ibool srv_backup_mode = FALSE; | 1151 | +UNIV_INTERN ibool srv_backup_mode = FALSE; |
352 | 1152 | +UNIV_INTERN ibool srv_close_files = FALSE; | ||
353 | 1151 | + | 1153 | + |
354 | 1152 | UNIV_INTERN long long srv_ibuf_max_size = 0; | 1154 | UNIV_INTERN long long srv_ibuf_max_size = 0; |
355 | 1153 | UNIV_INTERN ulint srv_ibuf_active_contract = 0; /* 0:disable 1:enable */ | 1155 | UNIV_INTERN ulint srv_ibuf_active_contract = 0; /* 0:disable 1:enable */ |
356 | 1154 | UNIV_INTERN ulint srv_ibuf_accel_rate = 100; | 1156 | UNIV_INTERN ulint srv_ibuf_accel_rate = 100; |
358 | 1155 | @@ -1095,7 +1095,7 @@ | 1157 | @@ -1095,7 +1096,7 @@ |
359 | 1156 | } | 1158 | } |
360 | 1157 | 1159 | ||
361 | 1158 | /* Initialize some INFORMATION SCHEMA internal structures */ | 1160 | /* Initialize some INFORMATION SCHEMA internal structures */ |
362 | @@ -1161,7 +1163,7 @@ | |||
363 | 1161 | } | 1163 | } |
364 | 1162 | 1164 | ||
365 | 1163 | /*********************************************************************//** | 1165 | /*********************************************************************//** |
367 | 1164 | @@ -1106,6 +1106,7 @@ | 1166 | @@ -1106,6 +1107,7 @@ |
368 | 1165 | /*==========*/ | 1167 | /*==========*/ |
369 | 1166 | { | 1168 | { |
370 | 1167 | os_fast_mutex_free(&srv_conc_mutex); | 1169 | os_fast_mutex_free(&srv_conc_mutex); |
371 | @@ -1169,7 +1171,7 @@ | |||
372 | 1169 | mem_free(srv_conc_slots); | 1171 | mem_free(srv_conc_slots); |
373 | 1170 | srv_conc_slots = NULL; | 1172 | srv_conc_slots = NULL; |
374 | 1171 | 1173 | ||
376 | 1172 | @@ -1119,6 +1120,7 @@ | 1174 | @@ -1119,6 +1121,7 @@ |
377 | 1173 | srv_mysql_table = NULL; | 1175 | srv_mysql_table = NULL; |
378 | 1174 | 1176 | ||
379 | 1175 | trx_i_s_cache_free(trx_i_s_cache); | 1177 | trx_i_s_cache_free(trx_i_s_cache); |
380 | @@ -1177,7 +1179,7 @@ | |||
381 | 1177 | } | 1179 | } |
382 | 1178 | 1180 | ||
383 | 1179 | /*********************************************************************//** | 1181 | /*********************************************************************//** |
385 | 1180 | @@ -2634,36 +2636,6 @@ | 1182 | @@ -2634,36 +2637,6 @@ |
386 | 1181 | old_sema = sema; | 1183 | old_sema = sema; |
387 | 1182 | } | 1184 | } |
388 | 1183 | 1185 | ||
389 | 1184 | 1186 | ||
390 | === modified file 'patches/xtradb55.patch' | |||
391 | --- patches/xtradb55.patch 2014-02-23 01:28:49 +0000 | |||
392 | +++ patches/xtradb55.patch 2014-09-10 11:23:06 +0000 | |||
393 | @@ -382,7 +382,7 @@ | |||
394 | 382 | + inconsistencies between the file name and the actual tablespace contents | 382 | + inconsistencies between the file name and the actual tablespace contents |
395 | 383 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and | 383 | + if a DDL occurs between a fil_load_single_table_tablespaces() call and |
396 | 384 | + the actual copy operation. */ | 384 | + the actual copy operation. */ |
398 | 385 | + if (srv_backup_mode) { | 385 | + if (srv_backup_mode && !srv_close_files) { |
399 | 386 | + | 386 | + |
400 | 387 | + fil_node_t* node; | 387 | + fil_node_t* node; |
401 | 388 | + fil_space_t* space; | 388 | + fil_space_t* space; |
402 | @@ -791,7 +791,7 @@ | |||
403 | 791 | extern char srv_adaptive_flushing; | 791 | extern char srv_adaptive_flushing; |
404 | 792 | 792 | ||
405 | 793 | /* If this flag is TRUE, then we will load the indexes' (and tables') metadata | 793 | /* If this flag is TRUE, then we will load the indexes' (and tables') metadata |
407 | 794 | @@ -271,6 +270,11 @@ | 794 | @@ -271,6 +270,12 @@ |
408 | 795 | extern ulint srv_expand_import; | 795 | extern ulint srv_expand_import; |
409 | 796 | extern ulint srv_pass_corrupt_table; | 796 | extern ulint srv_pass_corrupt_table; |
410 | 797 | 797 | ||
411 | @@ -799,6 +799,7 @@ | |||
412 | 799 | +extern ibool srv_fake_write; | 799 | +extern ibool srv_fake_write; |
413 | 800 | +extern ibool srv_apply_log_only; | 800 | +extern ibool srv_apply_log_only; |
414 | 801 | +extern ibool srv_backup_mode; | 801 | +extern ibool srv_backup_mode; |
415 | 802 | +extern ibool srv_close_files; | ||
416 | 802 | + | 803 | + |
417 | 803 | /* Helper macro to support srv_pass_corrupt_table checks. If 'cond' is FALSE, | 804 | /* Helper macro to support srv_pass_corrupt_table checks. If 'cond' is FALSE, |
418 | 804 | execute 'code' if srv_pass_corrupt_table is non-zero, or trigger a fatal error | 805 | execute 'code' if srv_pass_corrupt_table is non-zero, or trigger a fatal error |
419 | @@ -1193,7 +1194,7 @@ | |||
420 | 1193 | 1194 | ||
421 | 1194 | /* Try to flush dirty pages so as to avoid IO bursts at | 1195 | /* Try to flush dirty pages so as to avoid IO bursts at |
422 | 1195 | the checkpoints. */ | 1196 | the checkpoints. */ |
424 | 1196 | @@ -435,6 +428,11 @@ | 1197 | @@ -435,6 +428,12 @@ |
425 | 1197 | UNIV_INTERN ulint srv_pass_corrupt_table = 0; /* 0:disable 1:enable */ | 1198 | UNIV_INTERN ulint srv_pass_corrupt_table = 0; /* 0:disable 1:enable */ |
426 | 1198 | 1199 | ||
427 | 1199 | UNIV_INTERN ulint srv_dict_size_limit = 0; | 1200 | UNIV_INTERN ulint srv_dict_size_limit = 0; |
428 | @@ -1202,10 +1203,11 @@ | |||
429 | 1202 | +UNIV_INTERN ibool srv_fake_write = FALSE; | 1203 | +UNIV_INTERN ibool srv_fake_write = FALSE; |
430 | 1203 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; | 1204 | +UNIV_INTERN ibool srv_apply_log_only = FALSE; |
431 | 1204 | +UNIV_INTERN ibool srv_backup_mode = FALSE; | 1205 | +UNIV_INTERN ibool srv_backup_mode = FALSE; |
432 | 1206 | +UNIV_INTERN ibool srv_close_files = FALSE; | ||
433 | 1205 | /*-------------------------------------------*/ | 1207 | /*-------------------------------------------*/ |
434 | 1206 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; | 1208 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; |
435 | 1207 | UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; | 1209 | UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; |
437 | 1208 | @@ -1185,7 +1183,7 @@ | 1210 | @@ -1185,7 +1184,7 @@ |
438 | 1209 | } | 1211 | } |
439 | 1210 | 1212 | ||
440 | 1211 | /* Initialize some INFORMATION SCHEMA internal structures */ | 1213 | /* Initialize some INFORMATION SCHEMA internal structures */ |
441 | @@ -1214,7 +1216,7 @@ | |||
442 | 1214 | } | 1216 | } |
443 | 1215 | 1217 | ||
444 | 1216 | /*********************************************************************//** | 1218 | /*********************************************************************//** |
446 | 1217 | @@ -1196,6 +1194,7 @@ | 1219 | @@ -1196,6 +1195,7 @@ |
447 | 1218 | /*==========*/ | 1220 | /*==========*/ |
448 | 1219 | { | 1221 | { |
449 | 1220 | os_fast_mutex_free(&srv_conc_mutex); | 1222 | os_fast_mutex_free(&srv_conc_mutex); |
450 | @@ -1222,7 +1224,7 @@ | |||
451 | 1222 | mem_free(srv_conc_slots); | 1224 | mem_free(srv_conc_slots); |
452 | 1223 | srv_conc_slots = NULL; | 1225 | srv_conc_slots = NULL; |
453 | 1224 | 1226 | ||
455 | 1225 | @@ -1209,6 +1208,7 @@ | 1227 | @@ -1209,6 +1209,7 @@ |
456 | 1226 | srv_mysql_table = NULL; | 1228 | srv_mysql_table = NULL; |
457 | 1227 | 1229 | ||
458 | 1228 | trx_i_s_cache_free(trx_i_s_cache); | 1230 | trx_i_s_cache_free(trx_i_s_cache); |
459 | @@ -1230,7 +1232,7 @@ | |||
460 | 1230 | } | 1232 | } |
461 | 1231 | 1233 | ||
462 | 1232 | /*********************************************************************//** | 1234 | /*********************************************************************//** |
464 | 1233 | @@ -1952,7 +1952,7 @@ | 1235 | @@ -1952,7 +1953,7 @@ |
465 | 1234 | } | 1236 | } |
466 | 1235 | 1237 | ||
467 | 1236 | /* Record the lock wait time for this thread */ | 1238 | /* Record the lock wait time for this thread */ |
468 | @@ -1239,7 +1241,7 @@ | |||
469 | 1239 | } | 1241 | } |
470 | 1240 | 1242 | ||
471 | 1241 | if (trx->was_chosen_as_deadlock_victim) { | 1243 | if (trx->was_chosen_as_deadlock_victim) { |
473 | 1242 | @@ -2975,36 +2975,6 @@ | 1244 | @@ -2975,36 +2976,6 @@ |
474 | 1243 | old_sema = sema; | 1245 | old_sema = sema; |
475 | 1244 | } | 1246 | } |
476 | 1245 | 1247 | ||
477 | 1246 | 1248 | ||
478 | === modified file 'src/fil_cur.cc' | |||
479 | --- src/fil_cur.cc 2014-03-01 13:30:44 +0000 | |||
480 | +++ src/fil_cur.cc 2014-09-10 11:23:06 +0000 | |||
481 | @@ -162,7 +162,7 @@ | |||
482 | 162 | /* In the backup mode we should already have a tablespace handle created | 162 | /* In the backup mode we should already have a tablespace handle created |
483 | 163 | by fil_load_single_table_tablespace() unless it is a system | 163 | by fil_load_single_table_tablespace() unless it is a system |
484 | 164 | tablespace. Otherwise we open the file here. */ | 164 | tablespace. Otherwise we open the file here. */ |
486 | 165 | if (cursor->is_system || !srv_backup_mode) { | 165 | if (cursor->is_system || !srv_backup_mode || srv_close_files) { |
487 | 166 | node->handle = | 166 | node->handle = |
488 | 167 | xb_file_create_no_error_handling(node->name, | 167 | xb_file_create_no_error_handling(node->name, |
489 | 168 | OS_FILE_OPEN, | 168 | OS_FILE_OPEN, |
490 | 169 | 169 | ||
491 | === modified file 'src/xtrabackup.cc' | |||
492 | --- src/xtrabackup.cc 2014-09-09 17:22:21 +0000 | |||
493 | +++ src/xtrabackup.cc 2014-09-10 11:23:06 +0000 | |||
494 | @@ -298,6 +298,7 @@ | |||
495 | 298 | lsn_t xtrabackup_arch_last_file_lsn = 0ULL; | 298 | lsn_t xtrabackup_arch_last_file_lsn = 0ULL; |
496 | 299 | 299 | ||
497 | 300 | ulong xb_open_files_limit= 0; | 300 | ulong xb_open_files_limit= 0; |
498 | 301 | my_bool xb_close_files= FALSE; | ||
499 | 301 | 302 | ||
500 | 302 | /* Datasinks */ | 303 | /* Datasinks */ |
501 | 303 | ds_ctxt_t *ds_data = NULL; | 304 | ds_ctxt_t *ds_data = NULL; |
502 | @@ -487,7 +488,8 @@ | |||
503 | 487 | #endif | 488 | #endif |
504 | 488 | OPT_XTRA_INCREMENTAL_FORCE_SCAN, | 489 | OPT_XTRA_INCREMENTAL_FORCE_SCAN, |
505 | 489 | OPT_DEFAULTS_GROUP, | 490 | OPT_DEFAULTS_GROUP, |
507 | 490 | OPT_OPEN_FILES_LIMIT | 491 | OPT_OPEN_FILES_LIMIT, |
508 | 492 | OPT_CLOSE_FILES | ||
509 | 491 | }; | 493 | }; |
510 | 492 | 494 | ||
511 | 493 | #if MYSQL_VERSION_ID >= 50600 | 495 | #if MYSQL_VERSION_ID >= 50600 |
512 | @@ -915,6 +917,10 @@ | |||
513 | 915 | (G_PTR*) &xb_open_files_limit, (G_PTR*) &xb_open_files_limit, 0, GET_ULONG, | 917 | (G_PTR*) &xb_open_files_limit, (G_PTR*) &xb_open_files_limit, 0, GET_ULONG, |
514 | 916 | REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0}, | 918 | REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0}, |
515 | 917 | 919 | ||
516 | 920 | {"close_files", OPT_CLOSE_FILES, "do not keep files opened. Use at your own " | ||
517 | 921 | "risk.", (G_PTR*) &xb_close_files, (G_PTR*) &xb_close_files, 0, GET_BOOL, | ||
518 | 922 | NO_ARG, 0, 0, 0, 0, 0, 0}, | ||
519 | 923 | |||
520 | 918 | { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} | 924 | { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} |
521 | 919 | }; | 925 | }; |
522 | 920 | 926 | ||
523 | @@ -3059,6 +3065,13 @@ | |||
524 | 3059 | xb_set_innodb_read_only(); | 3065 | xb_set_innodb_read_only(); |
525 | 3060 | 3066 | ||
526 | 3061 | srv_backup_mode = TRUE; | 3067 | srv_backup_mode = TRUE; |
527 | 3068 | srv_close_files = xb_close_files; | ||
528 | 3069 | |||
529 | 3070 | if (srv_close_files) | ||
530 | 3071 | msg("xtrabackup: warning: close-files specified. Use it " | ||
531 | 3072 | "at your own risk. If there are DDL operations like table DROP TABLE " | ||
532 | 3073 | "or RENAME TABLE during the backup, inconsistent backup will be " | ||
533 | 3074 | "produced.\n"); | ||
534 | 3062 | 3075 | ||
535 | 3063 | /* initialize components */ | 3076 | /* initialize components */ |
536 | 3064 | if(innodb_init_param()) | 3077 | if(innodb_init_param()) |
537 | 3065 | 3078 | ||
538 | === modified file 'test/inc/common.sh' | |||
539 | --- test/inc/common.sh 2014-09-10 07:36:39 +0000 | |||
540 | +++ test/inc/common.sh 2014-09-10 11:23:06 +0000 | |||
541 | @@ -240,7 +240,7 @@ | |||
542 | 240 | fi | 240 | fi |
543 | 241 | 241 | ||
544 | 242 | IB_ARGS="--defaults-file=$MYSQLD_VARDIR/my.cnf --ibbackup=$XB_BIN \ | 242 | IB_ARGS="--defaults-file=$MYSQLD_VARDIR/my.cnf --ibbackup=$XB_BIN \ |
546 | 243 | --no-version-check" | 243 | --no-version-check ${IB_EXTRA_OPTS:-}" |
547 | 244 | XB_ARGS="--defaults-file=$MYSQLD_VARDIR/my.cnf" | 244 | XB_ARGS="--defaults-file=$MYSQLD_VARDIR/my.cnf" |
548 | 245 | 245 | ||
549 | 246 | # Some aliases for compatibility, as tests use the following names | 246 | # Some aliases for compatibility, as tests use the following names |
550 | @@ -303,6 +303,9 @@ | |||
551 | 303 | [client] | 303 | [client] |
552 | 304 | socket=${MYSQLD_SOCKET} | 304 | socket=${MYSQLD_SOCKET} |
553 | 305 | user=root | 305 | user=root |
554 | 306 | |||
555 | 307 | [xtrabackup] | ||
556 | 308 | ${XB_EXTRA_MY_CNF_OPTS:-} | ||
557 | 306 | EOF | 309 | EOF |
558 | 307 | 310 | ||
559 | 308 | # Create datadir and call mysql_install_db if it doesn't exist | 311 | # Create datadir and call mysql_install_db if it doesn't exist |
560 | 309 | 312 | ||
561 | === modified file 'test/run.sh' | |||
562 | --- test/run.sh 2014-05-12 08:40:00 +0000 | |||
563 | +++ test/run.sh 2014-09-10 11:23:06 +0000 | |||
564 | @@ -51,6 +51,8 @@ | |||
565 | 51 | on the MySQL version. | 51 | on the MySQL version. |
566 | 52 | -j N Run tests in N parallel processes. | 52 | -j N Run tests in N parallel processes. |
567 | 53 | -T seconds Test timeout (default is $TEST_TIMEOUT seconds). | 53 | -T seconds Test timeout (default is $TEST_TIMEOUT seconds). |
568 | 54 | -x options Extra options to pass to xtrabackup | ||
569 | 55 | -i options Extra options to pass to innobackupex | ||
570 | 54 | EOF | 56 | EOF |
571 | 55 | } | 57 | } |
572 | 56 | 58 | ||
573 | @@ -263,6 +265,9 @@ | |||
574 | 263 | if gnutar --version > /dev/null 2>&1 | 265 | if gnutar --version > /dev/null 2>&1 |
575 | 264 | then | 266 | then |
576 | 265 | TAR=gnutar | 267 | TAR=gnutar |
577 | 268 | elif gtar --version > /dev/null 2>&1 | ||
578 | 269 | then | ||
579 | 270 | TAR=gtar | ||
580 | 266 | else | 271 | else |
581 | 267 | TAR=tar | 272 | TAR=tar |
582 | 268 | fi | 273 | fi |
583 | @@ -324,7 +329,7 @@ | |||
584 | 324 | MYSQLD_EXTRA_ARGS= | 329 | MYSQLD_EXTRA_ARGS= |
585 | 325 | 330 | ||
586 | 326 | XB_BIN="" | 331 | XB_BIN="" |
588 | 327 | IB_ARGS="--user=root --ibbackup=$XB_BIN" | 332 | IB_ARGS="--user=root --ibbackup=$XB_BIN ${IB_EXTRA_OPTS:-}" |
589 | 328 | XB_ARGS="--no-defaults" | 333 | XB_ARGS="--no-defaults" |
590 | 329 | 334 | ||
591 | 330 | if [ "$XB_BUILD" != "autodetect" ] | 335 | if [ "$XB_BUILD" != "autodetect" ] |
592 | @@ -794,7 +799,7 @@ | |||
593 | 794 | NWORKERS= | 799 | NWORKERS= |
594 | 795 | DEBUG_WORKER="" | 800 | DEBUG_WORKER="" |
595 | 796 | 801 | ||
597 | 797 | while getopts "fgh?:t:s:d:c:j:T:" options; do | 802 | while getopts "fgh?:t:s:d:c:j:T:x:i:" options; do |
598 | 798 | case $options in | 803 | case $options in |
599 | 799 | f ) force="yes";; | 804 | f ) force="yes";; |
600 | 800 | t ) | 805 | t ) |
601 | @@ -831,6 +836,14 @@ | |||
602 | 831 | TEST_TIMEOUT="$OPTARG" | 836 | TEST_TIMEOUT="$OPTARG" |
603 | 832 | ;; | 837 | ;; |
604 | 833 | 838 | ||
605 | 839 | x ) | ||
606 | 840 | XB_EXTRA_MY_CNF_OPTS="$OPTARG" | ||
607 | 841 | ;; | ||
608 | 842 | |||
609 | 843 | i ) | ||
610 | 844 | IB_EXTRA_OPTS="$OPTARG" | ||
611 | 845 | ;; | ||
612 | 846 | |||
613 | 834 | ? ) echo "Use \`$0 -h' for the list of available options." | 847 | ? ) echo "Use \`$0 -h' for the list of available options." |
614 | 835 | exit -1;; | 848 | exit -1;; |
615 | 836 | esac | 849 | esac |
616 | 837 | 850 | ||
617 | === added file 'test/t/bug1222062.sh' | |||
618 | --- test/t/bug1222062.sh 1970-01-01 00:00:00 +0000 | |||
619 | +++ test/t/bug1222062.sh 2014-09-10 11:23:06 +0000 | |||
620 | @@ -0,0 +1,11 @@ | |||
621 | 1 | ######################################################################## | ||
622 | 2 | # Bug #1222062: add option --close-files | ||
623 | 3 | ######################################################################## | ||
624 | 4 | |||
625 | 5 | start_server | ||
626 | 6 | |||
627 | 7 | mkdir $topdir/backup | ||
628 | 8 | |||
629 | 9 | innobackupex --close-files $topdir/backup | ||
630 | 10 | |||
631 | 11 | grep "xtrabackup: warning: close-files specified" $OUTFILE |
Sergei,
- I would call the option just ‘--close-files’, because ‘handlers’ looks file_handlers should be initialized to FALSE for consistency
confusing (and should be ‘handles’ for that matter).
- users are generally not supposed to call xtrabackup directly, but use
innobackupex instead. Why is there no corresponding innobackupex
option?
- please add the warning to the built-in help for xtrabackup option
- please also update the docs (with the “use at your own risk” warning )
- the ‘-i’ option to run.sh has been added to usage text, but is not
actually handled
- XB_EXTRA_ARGS in run.sh is unused
- srv_close_