Merge lp:~akopytov/percona-xtrabackup/support-remote-tablespaces-2.0 into lp:percona-xtrabackup/2.0
- support-remote-tablespaces-2.0
- Merge into 2.0
Status: | Merged |
---|---|
Approved by: | Laurynas Biveinis |
Approved revision: | no longer in the source branch. |
Merged at revision: | 545 |
Proposed branch: | lp:~akopytov/percona-xtrabackup/support-remote-tablespaces-2.0 |
Merge into: | lp:percona-xtrabackup/2.0 |
Prerequisite: | lp:~akopytov/percona-xtrabackup/bug1169169-2.0 |
Diff against target: |
1849 lines (+769/-195) 23 files modified
innobackupex (+68/-14) patches/innodb56.patch (+293/-38) src/xtrabackup.cc (+147/-51) test/inc/common.sh (+47/-27) test/inc/ib_part.sh (+5/-5) test/t/bug1062684.sh (+11/-4) test/t/bug483827.sh (+1/-4) test/t/bug606981.sh (+9/-5) test/t/bug740489.sh (+22/-14) test/t/bug759225.sh (+6/-4) test/t/bug870119.sh (+6/-3) test/t/bug891496.sh (+6/-8) test/t/bug976945.sh (+4/-2) test/t/bug977101.sh (+3/-4) test/t/ib_doublewrite.sh (+6/-3) test/t/ib_part_include.sh (+2/-2) test/t/ib_part_tf_innodb.sh (+2/-2) test/t/ib_slave_info.sh (+2/-2) test/t/remote_tablespaces.sh (+53/-0) test/t/undo_tablespaces.sh (+75/-0) test/t/xb_basic.sh (+0/-1) test/t/xb_version.sh (+0/-1) test/testrun.sh (+1/-1) |
To merge this branch: | bzr merge lp:~akopytov/percona-xtrabackup/support-remote-tablespaces-2.0 |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Laurynas Biveinis (community) | Approve | ||
Review via email: mp+160315@code.launchpad.net |
Commit message
Description of the change
Implementation of
https:/
On backup, copy both .isl and .ibd files for remote tablespaces. Remote
.ibd files are copied to the corresponding database directory under the
backup root directory as if there were local tablespaces.
On prepare, ignore .isl files and possible inconsistencies of tablespace
locations with the data dictionary, i.e. handle all tablespaces as local
ones.
On restore, innobackupex checks if there's an .isl file corresponding to
the .ibd file being copied. If so, it uses the original remote
tablespace location instead of the default location under the data
directory.
Changes in the ib_part_* tests are necessery to support 2 additional SYS_*
tables in the data dictionary (SYS_TABLESPACES and SYS_DATAFILES). To
avoid dependency on the number of SYS_* tables, they are now excluded
from the 'xtrabackup --stats' output, i.e. only user tables are counted.
http://
Alexey Kopytov (akopytov) wrote : | # |
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
I assume rev 534 is not a part of this MP, and only reviewed rev 535.
Preview Diff
1 | === modified file 'innobackupex' | |||
2 | --- innobackupex 2013-04-03 07:04:25 +0000 | |||
3 | +++ innobackupex 2013-04-23 10:01:01 +0000 | |||
4 | @@ -230,6 +230,7 @@ | |||
5 | 230 | my $copy_dir_dst; | 230 | my $copy_dir_dst; |
6 | 231 | my $copy_dir_exclude_regexp; | 231 | my $copy_dir_exclude_regexp; |
7 | 232 | my $copy_dir_overwrite; | 232 | my $copy_dir_overwrite; |
8 | 233 | my $copy_dir_resolve_isl; | ||
9 | 233 | 234 | ||
10 | 234 | ###################################################################### | 235 | ###################################################################### |
11 | 235 | # program execution begins here | 236 | # program execution begins here |
12 | @@ -618,11 +619,31 @@ | |||
13 | 618 | # | 619 | # |
14 | 619 | sub process_file { | 620 | sub process_file { |
15 | 620 | my $process_func = shift; | 621 | my $process_func = shift; |
16 | 622 | my $dst_path; | ||
17 | 621 | 623 | ||
18 | 622 | if (/$copy_dir_exclude_regexp/) { | 624 | if (/$copy_dir_exclude_regexp/) { |
19 | 623 | return; | 625 | return; |
20 | 624 | } | 626 | } |
22 | 625 | (my $dst_path = $File::Find::name) =~ s/^$copy_dir_src/$copy_dir_dst/; | 627 | |
23 | 628 | # If requested, check if there is a "link" in the .isl file for an InnoDB | ||
24 | 629 | # tablespace and use it as a destination path. | ||
25 | 630 | if ($copy_dir_resolve_isl && $File::Find::name =~ m/\.ibd$/) { | ||
26 | 631 | my $isl_path; | ||
27 | 632 | |||
28 | 633 | ($isl_path = $File::Find::name) =~ s/\.ibd$/.isl/; | ||
29 | 634 | if (-e "$isl_path") { | ||
30 | 635 | my @lines; | ||
31 | 636 | print STDERR "Found an .isl file for $File::Find::name\n"; | ||
32 | 637 | file_to_array($isl_path, \@lines); | ||
33 | 638 | $dst_path = $lines[0]; | ||
34 | 639 | print STDERR "Using $dst_path as the destination path\n"; | ||
35 | 640 | } | ||
36 | 641 | } | ||
37 | 642 | |||
38 | 643 | if (! defined $dst_path) { | ||
39 | 644 | ($dst_path = $File::Find::name) =~ s/^$copy_dir_src/$copy_dir_dst/; | ||
40 | 645 | } | ||
41 | 646 | |||
42 | 626 | if (-d "$File::Find::name") { | 647 | if (-d "$File::Find::name") { |
43 | 627 | # Create the directory in the destination if necessary | 648 | # Create the directory in the destination if necessary |
44 | 628 | if (! -e "$dst_path") { | 649 | if (! -e "$dst_path") { |
45 | @@ -657,14 +678,16 @@ | |||
46 | 657 | } | 678 | } |
47 | 658 | 679 | ||
48 | 659 | # | 680 | # |
52 | 660 | # copy_dir_recursively subroutine does a recursive copy of a specified | 681 | # copy_dir_recursively subroutine does a recursive copy of a specified directory |
53 | 661 | # directory excluding files matching a specifies regexp. If $overwrite | 682 | # excluding files matching a specifies regexp. If $overwrite is 1, it overwrites |
54 | 662 | # is 1, it overwrites the existing files. | 683 | # the existing files. If $resolve_isl is 1, it also resolves InnoDB .isl files, |
55 | 684 | # i.e. copies to the absolute path specified in the corresponding .isl file | ||
56 | 685 | # rather than the default location | ||
57 | 663 | # | 686 | # |
58 | 664 | # SYNOPSIS | 687 | # SYNOPSIS |
59 | 665 | # | 688 | # |
60 | 666 | # copy_dir_recursively($src_dir, $dst_dir, $exclude_regexp, | 689 | # copy_dir_recursively($src_dir, $dst_dir, $exclude_regexp, |
62 | 667 | # $overwrite); | 690 | # $overwrite, $resolve_isl); |
63 | 668 | # | 691 | # |
64 | 669 | # TODO | 692 | # TODO |
65 | 670 | # | 693 | # |
66 | @@ -676,6 +699,7 @@ | |||
67 | 676 | $copy_dir_dst = File::Spec->canonpath(shift); | 699 | $copy_dir_dst = File::Spec->canonpath(shift); |
68 | 677 | $copy_dir_exclude_regexp = shift; | 700 | $copy_dir_exclude_regexp = shift; |
69 | 678 | $copy_dir_overwrite = shift; | 701 | $copy_dir_overwrite = shift; |
70 | 702 | $copy_dir_resolve_isl = shift; | ||
71 | 679 | 703 | ||
72 | 680 | find(\©_file_callback, $copy_dir_src); | 704 | find(\©_file_callback, $copy_dir_src); |
73 | 681 | } | 705 | } |
74 | @@ -686,7 +710,7 @@ | |||
75 | 686 | # SYNOPSIS | 710 | # SYNOPSIS |
76 | 687 | # | 711 | # |
77 | 688 | # move_dir_recursively($src_dir, $dst_dir, $exclude_regexp, | 712 | # move_dir_recursively($src_dir, $dst_dir, $exclude_regexp, |
79 | 689 | # $overwrite); | 713 | # $overwrite, $resolve_isl); |
80 | 690 | # | 714 | # |
81 | 691 | # TODO | 715 | # TODO |
82 | 692 | # | 716 | # |
83 | @@ -698,6 +722,7 @@ | |||
84 | 698 | $copy_dir_dst = File::Spec->canonpath(shift); | 722 | $copy_dir_dst = File::Spec->canonpath(shift); |
85 | 699 | $copy_dir_exclude_regexp = shift; | 723 | $copy_dir_exclude_regexp = shift; |
86 | 700 | $copy_dir_overwrite = shift; | 724 | $copy_dir_overwrite = shift; |
87 | 725 | $copy_dir_resolve_isl = shift; | ||
88 | 701 | 726 | ||
89 | 702 | find(\&move_file_callback, $copy_dir_src); | 727 | find(\&move_file_callback, $copy_dir_src); |
90 | 703 | } | 728 | } |
91 | @@ -715,12 +740,15 @@ | |||
92 | 715 | get_option(\%config, $option_defaults_group, 'innodb_data_file_path'); | 740 | get_option(\%config, $option_defaults_group, 'innodb_data_file_path'); |
93 | 716 | my $orig_iblog_dir = | 741 | my $orig_iblog_dir = |
94 | 717 | get_option(\%config, $option_defaults_group, 'innodb_log_group_home_dir'); | 742 | get_option(\%config, $option_defaults_group, 'innodb_log_group_home_dir'); |
95 | 743 | my $orig_undo_dir = $orig_ibdata_dir; | ||
96 | 718 | my $iblog_files = 'ib_logfile.*'; | 744 | my $iblog_files = 'ib_logfile.*'; |
97 | 745 | my $ibundo_files = 'undo[0-9]{3}'; | ||
98 | 719 | my $excluded_files = | 746 | my $excluded_files = |
99 | 720 | '\.\.?|backup-my\.cnf|xtrabackup_logfile|' . | 747 | '\.\.?|backup-my\.cnf|xtrabackup_logfile|' . |
101 | 721 | 'xtrabackup_binary|xtrabackup_binlog_info|xtrabackup_checkpoints|' . | 748 | 'xtrabackup_binary|xtrabackup_binlog_info|xtrabackup_checkpoints|' . |
102 | 722 | '.*\.qp|' . | 749 | '.*\.qp|' . |
104 | 723 | $iblog_files; | 750 | $iblog_files . '|'. |
105 | 751 | $ibundo_files; | ||
106 | 724 | my $compressed_data_file = '.*\.ibz$'; | 752 | my $compressed_data_file = '.*\.ibz$'; |
107 | 725 | my $file; | 753 | my $file; |
108 | 726 | my $backup_innodb_data_file_path; | 754 | my $backup_innodb_data_file_path; |
109 | @@ -732,6 +760,10 @@ | |||
110 | 732 | $excluded_files = $excluded_files . '|' . $doublewrite_file; | 760 | $excluded_files = $excluded_files . '|' . $doublewrite_file; |
111 | 733 | } | 761 | } |
112 | 734 | 762 | ||
113 | 763 | if (has_option(\%config, $option_defaults_group, 'innodb_undo_directory')) { | ||
114 | 764 | $orig_undo_dir = get_option(\%config, $option_defaults_group, | ||
115 | 765 | 'innodb_undo_directory'); | ||
116 | 766 | } | ||
117 | 735 | # check whether files should be copied or moved to dest directory | 767 | # check whether files should be copied or moved to dest directory |
118 | 736 | my $move_or_copy_file = $move_flag ? \&move_file : \©_file; | 768 | my $move_or_copy_file = $move_flag ? \&move_file : \©_file; |
119 | 737 | my $move_or_copy_dir = $move_flag ? | 769 | my $move_or_copy_dir = $move_flag ? |
120 | @@ -743,6 +775,10 @@ | |||
121 | 743 | if_directory_exists_and_empty($orig_datadir, "Original data"); | 775 | if_directory_exists_and_empty($orig_datadir, "Original data"); |
122 | 744 | if_directory_exists_and_empty($orig_ibdata_dir, "Original InnoDB data"); | 776 | if_directory_exists_and_empty($orig_ibdata_dir, "Original InnoDB data"); |
123 | 745 | if_directory_exists_and_empty($orig_iblog_dir, "Original InnoDB log"); | 777 | if_directory_exists_and_empty($orig_iblog_dir, "Original InnoDB log"); |
124 | 778 | if ($orig_undo_dir) { | ||
125 | 779 | if_directory_exists_and_empty($orig_undo_dir, | ||
126 | 780 | "Original undo directory"); | ||
127 | 781 | } | ||
128 | 746 | 782 | ||
129 | 747 | # check that the original options file and the backup options file have | 783 | # check that the original options file and the backup options file have |
130 | 748 | # the same value for "innodb_data_file_path" option | 784 | # the same value for "innodb_data_file_path" option |
131 | @@ -786,7 +822,7 @@ | |||
132 | 786 | my $excluded_regexp = '^(' . $excluded_files . ')$'; | 822 | my $excluded_regexp = '^(' . $excluded_files . ')$'; |
133 | 787 | print STDERR "$prefix Starting to $operation files in '$backup_dir'\n"; | 823 | print STDERR "$prefix Starting to $operation files in '$backup_dir'\n"; |
134 | 788 | print STDERR "$prefix back to original data directory '$orig_datadir'\n"; | 824 | print STDERR "$prefix back to original data directory '$orig_datadir'\n"; |
136 | 789 | &$move_or_copy_dir($backup_dir, $orig_datadir, $excluded_regexp, 0); | 825 | &$move_or_copy_dir($backup_dir, $orig_datadir, $excluded_regexp, 0, 1); |
137 | 790 | 826 | ||
138 | 791 | # copy InnoDB data files to original InnoDB data directory | 827 | # copy InnoDB data files to original InnoDB data directory |
139 | 792 | print STDERR "\n$prefix Starting to $operation InnoDB system tablespace\n"; | 828 | print STDERR "\n$prefix Starting to $operation InnoDB system tablespace\n"; |
140 | @@ -801,6 +837,22 @@ | |||
141 | 801 | &$move_or_copy_file($src_name, $dst_name); | 837 | &$move_or_copy_file($src_name, $dst_name); |
142 | 802 | } | 838 | } |
143 | 803 | 839 | ||
144 | 840 | # copy InnoDB undo tablespaces to innodb_undo_directory (if specified), or | ||
145 | 841 | # to the InnoDB data directory | ||
146 | 842 | print STDERR "\n$prefix Starting to $operation InnoDB undo tablespaces\n"; | ||
147 | 843 | print STDERR "$prefix in '$backup_dir'\n"; | ||
148 | 844 | print STDERR "$prefix back to '$orig_undo_dir'\n"; | ||
149 | 845 | opendir(DIR, $backup_dir) | ||
150 | 846 | || Die "Can't open directory '$backup_dir': $!\n"; | ||
151 | 847 | while (defined($file = readdir(DIR))) { | ||
152 | 848 | if ($file =~ /^$ibundo_files$/ && -f "$backup_dir/$file") { | ||
153 | 849 | $src_name = escape_path("$backup_dir/$file"); | ||
154 | 850 | $dst_name = escape_path("$orig_undo_dir"); | ||
155 | 851 | &$move_or_copy_file($src_name, $dst_name); | ||
156 | 852 | } | ||
157 | 853 | } | ||
158 | 854 | closedir(DIR); | ||
159 | 855 | |||
160 | 804 | # copy InnoDB log files to original InnoDB log directory | 856 | # copy InnoDB log files to original InnoDB log directory |
161 | 805 | opendir(DIR, $backup_dir) | 857 | opendir(DIR, $backup_dir) |
162 | 806 | || Die "Can't open directory '$backup_dir': $!\n"; | 858 | || Die "Can't open directory '$backup_dir': $!\n"; |
163 | @@ -897,7 +949,7 @@ | |||
164 | 897 | copy_dir_recursively($option_incremental_dir, $backup_dir, | 949 | copy_dir_recursively($option_incremental_dir, $backup_dir, |
165 | 898 | '^(\.\.?|backup-my\.cnf|xtrabackup_logfile|' . | 950 | '^(\.\.?|backup-my\.cnf|xtrabackup_logfile|' . |
166 | 899 | 'xtrabackup_binary|xtrabackup_checkpoints|' . | 951 | 'xtrabackup_binary|xtrabackup_checkpoints|' . |
168 | 900 | '.*\.delta|.*\.meta|ib_logfile.*)$', 1); | 952 | '.*\.delta|.*\.meta|ib_logfile.*)$', 1, 0); |
169 | 901 | # If the latest backup has no file, we need to remove the old | 953 | # If the latest backup has no file, we need to remove the old |
170 | 902 | # xtrabackup_slave_info file, because it is out of date | 954 | # xtrabackup_slave_info file, because it is out of date |
171 | 903 | # TODO: this will not be needed when bug #856400 is fixed. | 955 | # TODO: this will not be needed when bug #856400 is fixed. |
172 | @@ -1810,7 +1862,9 @@ | |||
173 | 1810 | "innodb_log_file_size", | 1862 | "innodb_log_file_size", |
174 | 1811 | "innodb_fast_checksum", | 1863 | "innodb_fast_checksum", |
175 | 1812 | "innodb_page_size", | 1864 | "innodb_page_size", |
177 | 1813 | "innodb_log_block_size" | 1865 | "innodb_log_block_size", |
178 | 1866 | "innodb_undo_directory", | ||
179 | 1867 | "innodb_undo_tablespaces" | ||
180 | 1814 | ); | 1868 | ); |
181 | 1815 | 1869 | ||
182 | 1816 | my $options_dump = "# This MySQL options file was generated by $innobackup_script.\n\n" . | 1870 | my $options_dump = "# This MySQL options file was generated by $innobackup_script.\n\n" . |
183 | @@ -2105,7 +2159,7 @@ | |||
184 | 2105 | 2159 | ||
185 | 2106 | 2160 | ||
186 | 2107 | # | 2161 | # |
188 | 2108 | # backup_files subroutine copies .frm, .MRG, .MYD and .MYI files to | 2162 | # backup_files subroutine copies .frm, .isl, .MRG, .MYD and .MYI files to |
189 | 2109 | # backup directory. | 2163 | # backup directory. |
190 | 2110 | # | 2164 | # |
191 | 2111 | sub backup_files { | 2165 | sub backup_files { |
192 | @@ -2114,7 +2168,7 @@ | |||
193 | 2114 | my @list; | 2168 | my @list; |
194 | 2115 | my $file; | 2169 | my $file; |
195 | 2116 | my $database; | 2170 | my $database; |
197 | 2117 | my $wildcard = '*.{frm,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}'; | 2171 | my $wildcard = '*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}'; |
198 | 2118 | my $rsync_file_list; | 2172 | my $rsync_file_list; |
199 | 2119 | my $operation; | 2173 | my $operation; |
200 | 2120 | my $rsync_tmpfile_pass1 = "$option_tmpdir/xtrabackup_rsyncfiles_pass1"; | 2174 | my $rsync_tmpfile_pass1 = "$option_tmpdir/xtrabackup_rsyncfiles_pass1"; |
201 | @@ -2172,7 +2226,7 @@ | |||
202 | 2172 | 2226 | ||
203 | 2173 | # copy files of this database | 2227 | # copy files of this database |
204 | 2174 | opendir(DBDIR, "$source_dir/$database"); | 2228 | opendir(DBDIR, "$source_dir/$database"); |
206 | 2175 | @list = grep(/\.(frm|MYD|MYI|MAD|MAI|MRG|TRG|TRN|ARM|ARZ|CSM|CSV|opt|par)$/, readdir(DBDIR)); | 2229 | @list = grep(/\.(frm|isl|MYD|MYI|MAD|MAI|MRG|TRG|TRN|ARM|ARZ|CSM|CSV|opt|par)$/, readdir(DBDIR)); |
207 | 2176 | closedir DBDIR; | 2230 | closedir DBDIR; |
208 | 2177 | $file_c = @list; | 2231 | $file_c = @list; |
209 | 2178 | if ($file_c <= $backup_file_print_limit) { | 2232 | if ($file_c <= $backup_file_print_limit) { |
210 | 2179 | 2233 | ||
211 | === modified file 'patches/innodb56.patch' | |||
212 | --- patches/innodb56.patch 2013-04-09 13:44:38 +0000 | |||
213 | +++ patches/innodb56.patch 2013-04-23 10:01:01 +0000 | |||
214 | @@ -47,16 +47,19 @@ | |||
215 | 47 | #include "trx0sys.h" | 47 | #include "trx0sys.h" |
216 | 48 | #include "row0mysql.h" | 48 | #include "row0mysql.h" |
217 | 49 | #ifndef UNIV_HOTBACKUP | 49 | #ifndef UNIV_HOTBACKUP |
219 | 50 | @@ -311,7 +313,7 @@ | 50 | @@ -311,10 +313,7 @@ |
220 | 51 | 51 | ||
221 | 52 | /** The tablespace memory cache. This variable is NULL before the module is | 52 | /** The tablespace memory cache. This variable is NULL before the module is |
222 | 53 | initialized. */ | 53 | initialized. */ |
223 | 54 | -static fil_system_t* fil_system = NULL; | 54 | -static fil_system_t* fil_system = NULL; |
224 | 55 | - | ||
225 | 56 | -/** Determine if (i) is a user tablespace id or not. */ | ||
226 | 57 | -# define fil_is_user_tablespace_id(i) ((i) > srv_undo_tablespaces_open) | ||
227 | 55 | +fil_system_t* fil_system = NULL; | 58 | +fil_system_t* fil_system = NULL; |
228 | 56 | 59 | ||
232 | 57 | /** Determine if (i) is a user tablespace id or not. */ | 60 | /** Determine if user has explicitly disabled fsync(). */ |
233 | 58 | # define fil_is_user_tablespace_id(i) ((i) > srv_undo_tablespaces_open) | 61 | #ifndef __WIN__ |
234 | 59 | @@ -376,7 +378,7 @@ | 62 | @@ -376,7 +375,7 @@ |
235 | 60 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys | 63 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
236 | 61 | mutex. */ | 64 | mutex. */ |
237 | 62 | static | 65 | static |
238 | @@ -65,7 +68,7 @@ | |||
239 | 65 | fil_node_prepare_for_io( | 68 | fil_node_prepare_for_io( |
240 | 66 | /*====================*/ | 69 | /*====================*/ |
241 | 67 | fil_node_t* node, /*!< in: file node */ | 70 | fil_node_t* node, /*!< in: file node */ |
243 | 68 | @@ -691,7 +693,7 @@ | 71 | @@ -691,7 +690,7 @@ |
244 | 69 | Opens a file of a node of a tablespace. The caller must own the fil_system | 72 | Opens a file of a node of a tablespace. The caller must own the fil_system |
245 | 70 | mutex. */ | 73 | mutex. */ |
246 | 71 | static | 74 | static |
247 | @@ -74,7 +77,7 @@ | |||
248 | 74 | fil_node_open_file( | 77 | fil_node_open_file( |
249 | 75 | /*===============*/ | 78 | /*===============*/ |
250 | 76 | fil_node_t* node, /*!< in: file node */ | 79 | fil_node_t* node, /*!< in: file node */ |
252 | 77 | @@ -725,6 +727,18 @@ | 80 | @@ -725,6 +724,18 @@ |
253 | 78 | OS_FILE_READ_ONLY, &success); | 81 | OS_FILE_READ_ONLY, &success); |
254 | 79 | if (!success) { | 82 | if (!success) { |
255 | 80 | /* The following call prints an error message */ | 83 | /* The following call prints an error message */ |
256 | @@ -93,7 +96,7 @@ | |||
257 | 93 | os_file_get_last_error(true); | 96 | os_file_get_last_error(true); |
258 | 94 | 97 | ||
259 | 95 | ut_print_timestamp(stderr); | 98 | ut_print_timestamp(stderr); |
261 | 96 | @@ -783,12 +797,17 @@ | 99 | @@ -783,12 +794,17 @@ |
262 | 97 | 100 | ||
263 | 98 | if (UNIV_UNLIKELY(space_id != space->id)) { | 101 | if (UNIV_UNLIKELY(space_id != space->id)) { |
264 | 99 | fprintf(stderr, | 102 | fprintf(stderr, |
265 | @@ -114,7 +117,7 @@ | |||
266 | 114 | } | 117 | } |
267 | 115 | 118 | ||
268 | 116 | if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED | 119 | if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED |
270 | 117 | @@ -825,8 +844,9 @@ | 120 | @@ -825,8 +841,9 @@ |
271 | 118 | } | 121 | } |
272 | 119 | 122 | ||
273 | 120 | if (size_bytes >= 1024 * 1024) { | 123 | if (size_bytes >= 1024 * 1024) { |
274 | @@ -126,7 +129,7 @@ | |||
275 | 126 | } | 129 | } |
276 | 127 | 130 | ||
277 | 128 | if (!fsp_flags_is_compressed(flags)) { | 131 | if (!fsp_flags_is_compressed(flags)) { |
279 | 129 | @@ -879,6 +899,8 @@ | 132 | @@ -879,6 +896,8 @@ |
280 | 130 | /* Put the node to the LRU list */ | 133 | /* Put the node to the LRU list */ |
281 | 131 | UT_LIST_ADD_FIRST(LRU, system->LRU, node); | 134 | UT_LIST_ADD_FIRST(LRU, system->LRU, node); |
282 | 132 | } | 135 | } |
283 | @@ -135,7 +138,7 @@ | |||
284 | 135 | } | 138 | } |
285 | 136 | 139 | ||
286 | 137 | /**********************************************************************//** | 140 | /**********************************************************************//** |
288 | 138 | @@ -1491,7 +1513,12 @@ | 141 | @@ -1491,7 +1510,12 @@ |
289 | 139 | the file yet; the following calls will open it and update the | 142 | the file yet; the following calls will open it and update the |
290 | 140 | size fields */ | 143 | size fields */ |
291 | 141 | 144 | ||
292 | @@ -149,7 +152,7 @@ | |||
293 | 149 | fil_node_complete_io(node, fil_system, OS_FILE_READ); | 152 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
294 | 150 | } | 153 | } |
295 | 151 | 154 | ||
297 | 152 | @@ -2095,7 +2122,7 @@ | 155 | @@ -2095,7 +2119,7 @@ |
298 | 153 | mem_free(path); | 156 | mem_free(path); |
299 | 154 | } | 157 | } |
300 | 155 | 158 | ||
301 | @@ -158,7 +161,7 @@ | |||
302 | 158 | /********************************************************//** | 161 | /********************************************************//** |
303 | 159 | Writes a log record about an .ibd file create/rename/delete. */ | 162 | Writes a log record about an .ibd file create/rename/delete. */ |
304 | 160 | static | 163 | static |
306 | 161 | @@ -2329,7 +2356,7 @@ | 164 | @@ -2329,7 +2353,7 @@ |
307 | 162 | space_id, name, path, flags, | 165 | space_id, name, path, flags, |
308 | 163 | DICT_TF2_USE_TABLESPACE, | 166 | DICT_TF2_USE_TABLESPACE, |
309 | 164 | FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { | 167 | FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { |
310 | @@ -167,7 +170,7 @@ | |||
311 | 167 | } | 170 | } |
312 | 168 | } | 171 | } |
313 | 169 | 172 | ||
315 | 170 | @@ -2687,7 +2714,7 @@ | 173 | @@ -2687,7 +2711,7 @@ |
316 | 171 | } | 174 | } |
317 | 172 | 175 | ||
318 | 173 | if (err == DB_SUCCESS) { | 176 | if (err == DB_SUCCESS) { |
319 | @@ -176,7 +179,7 @@ | |||
320 | 176 | /* Write a log record about the deletion of the .ibd | 179 | /* Write a log record about the deletion of the .ibd |
321 | 177 | file, so that ibbackup can replay it in the | 180 | file, so that ibbackup can replay it in the |
322 | 178 | --apply-log phase. We use a dummy mtr and the familiar | 181 | --apply-log phase. We use a dummy mtr and the familiar |
324 | 179 | @@ -3042,7 +3069,7 @@ | 182 | @@ -3042,7 +3066,7 @@ |
325 | 180 | 183 | ||
326 | 181 | mutex_exit(&fil_system->mutex); | 184 | mutex_exit(&fil_system->mutex); |
327 | 182 | 185 | ||
328 | @@ -185,7 +188,7 @@ | |||
329 | 185 | if (success && !recv_recovery_on) { | 188 | if (success && !recv_recovery_on) { |
330 | 186 | mtr_t mtr; | 189 | mtr_t mtr; |
331 | 187 | 190 | ||
333 | 188 | @@ -3426,7 +3453,7 @@ | 191 | @@ -3426,7 +3450,7 @@ |
334 | 189 | goto error_exit_1; | 192 | goto error_exit_1; |
335 | 190 | } | 193 | } |
336 | 191 | 194 | ||
337 | @@ -194,7 +197,7 @@ | |||
338 | 194 | { | 197 | { |
339 | 195 | mtr_t mtr; | 198 | mtr_t mtr; |
340 | 196 | ulint mlog_file_flag = 0; | 199 | ulint mlog_file_flag = 0; |
342 | 197 | @@ -3504,6 +3531,97 @@ | 200 | @@ -3504,6 +3528,97 @@ |
343 | 198 | #endif /* UNIV_LOG_ARCHIVE */ | 201 | #endif /* UNIV_LOG_ARCHIVE */ |
344 | 199 | }; | 202 | }; |
345 | 200 | 203 | ||
346 | @@ -292,7 +295,25 @@ | |||
347 | 292 | /********************************************************************//** | 295 | /********************************************************************//** |
348 | 293 | Tries to open a single-table tablespace and optionally checks that the | 296 | Tries to open a single-table tablespace and optionally checks that the |
349 | 294 | space id in it is correct. If this does not succeed, print an error message | 297 | space id in it is correct. If this does not succeed, print an error message |
351 | 295 | @@ -3712,11 +3830,15 @@ | 298 | @@ -3569,6 +3684,9 @@ |
352 | 299 | in the default location. If it is remote, it should not be here. */ | ||
353 | 300 | def.filepath = fil_make_ibd_name(tablename, false); | ||
354 | 301 | |||
355 | 302 | + /* We skip SYS_DATAFILES validation and remote tablespaces discovery for | ||
356 | 303 | + XtraBackup, as all tablespaces are local for XtraBackup recovery. */ | ||
357 | 304 | +#if 0 | ||
358 | 305 | /* The path_in was read from SYS_DATAFILES. */ | ||
359 | 306 | if (path_in) { | ||
360 | 307 | if (strcmp(def.filepath, path_in)) { | ||
361 | 308 | @@ -3616,6 +3734,7 @@ | ||
362 | 309 | tablespaces_found++; | ||
363 | 310 | } | ||
364 | 311 | } | ||
365 | 312 | +#endif | ||
366 | 313 | |||
367 | 314 | /* Always look for a file at the default location. */ | ||
368 | 315 | ut_a(def.filepath); | ||
369 | 316 | @@ -3712,11 +3831,15 @@ | ||
370 | 296 | /* The following call prints an error message */ | 317 | /* The following call prints an error message */ |
371 | 297 | os_file_get_last_error(true); | 318 | os_file_get_last_error(true); |
372 | 298 | 319 | ||
373 | @@ -309,7 +330,25 @@ | |||
374 | 309 | 330 | ||
375 | 310 | err = DB_CORRUPTION; | 331 | err = DB_CORRUPTION; |
376 | 311 | 332 | ||
378 | 312 | @@ -4135,7 +4257,7 @@ | 333 | @@ -4018,6 +4141,9 @@ |
379 | 334 | # endif /* !UNIV_HOTBACKUP */ | ||
380 | 335 | #endif | ||
381 | 336 | |||
382 | 337 | + /* Ignore .isl files on XtraBackup recovery. All tablespaces must be | ||
383 | 338 | + local. */ | ||
384 | 339 | + if (!recv_recovery_on) { | ||
385 | 340 | /* Check for a link file which locates a remote tablespace. */ | ||
386 | 341 | remote.success = fil_open_linked_file( | ||
387 | 342 | tablename, &remote.filepath, &remote.file); | ||
388 | 343 | @@ -4030,6 +4156,7 @@ | ||
389 | 344 | mem_free(remote.filepath); | ||
390 | 345 | } | ||
391 | 346 | } | ||
392 | 347 | + } | ||
393 | 348 | |||
394 | 349 | |||
395 | 350 | /* Try to open the tablespace in the datadir. */ | ||
396 | 351 | @@ -4135,7 +4262,7 @@ | ||
397 | 313 | cannot be ok. */ | 352 | cannot be ok. */ |
398 | 314 | ulong minimum_size = FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE; | 353 | ulong minimum_size = FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE; |
399 | 315 | if (size < minimum_size) { | 354 | if (size < minimum_size) { |
400 | @@ -318,7 +357,7 @@ | |||
401 | 318 | ib_logf(IB_LOG_LEVEL_ERROR, | 357 | ib_logf(IB_LOG_LEVEL_ERROR, |
402 | 319 | "The size of single-table tablespace file %s " | 358 | "The size of single-table tablespace file %s " |
403 | 320 | "is only " UINT64PF ", should be at least %lu!", | 359 | "is only " UINT64PF ", should be at least %lu!", |
405 | 321 | @@ -4263,7 +4385,7 @@ | 360 | @@ -4263,7 +4390,7 @@ |
406 | 322 | idea is to read as much good data as we can and jump over bad data. | 361 | idea is to read as much good data as we can and jump over bad data. |
407 | 323 | @return 0 if ok, -1 if error even after the retries, 1 if at the end | 362 | @return 0 if ok, -1 if error even after the retries, 1 if at the end |
408 | 324 | of the directory */ | 363 | of the directory */ |
409 | @@ -327,7 +366,7 @@ | |||
410 | 327 | int | 366 | int |
411 | 328 | fil_file_readdir_next_file( | 367 | fil_file_readdir_next_file( |
412 | 329 | /*=======================*/ | 368 | /*=======================*/ |
414 | 330 | @@ -4359,7 +4481,9 @@ | 369 | @@ -4359,7 +4486,9 @@ |
415 | 331 | "%s/%s", fil_path_to_mysql_datadir, dbinfo.name); | 370 | "%s/%s", fil_path_to_mysql_datadir, dbinfo.name); |
416 | 332 | srv_normalize_path_for_win(dbpath); | 371 | srv_normalize_path_for_win(dbpath); |
417 | 333 | 372 | ||
418 | @@ -338,7 +377,23 @@ | |||
419 | 338 | 377 | ||
420 | 339 | if (dbdir != NULL) { | 378 | if (dbdir != NULL) { |
421 | 340 | 379 | ||
423 | 341 | @@ -4538,6 +4662,7 @@ | 380 | @@ -4380,9 +4509,13 @@ |
424 | 381 | && (0 == strcmp(fileinfo.name | ||
425 | 382 | + strlen(fileinfo.name) - 4, | ||
426 | 383 | ".ibd") | ||
427 | 384 | - || 0 == strcmp(fileinfo.name | ||
428 | 385 | + /* Ignore .isl files on XtraBackup | ||
429 | 386 | + recovery, all tablespaces must be | ||
430 | 387 | + local. */ | ||
431 | 388 | + || (!recv_recovery_on && | ||
432 | 389 | + 0 == strcmp(fileinfo.name | ||
433 | 390 | + strlen(fileinfo.name) - 4, | ||
434 | 391 | - ".isl"))) { | ||
435 | 392 | + ".isl")))) { | ||
436 | 393 | /* The name ends in .ibd or .isl; | ||
437 | 394 | try opening the file */ | ||
438 | 395 | fil_load_single_table_tablespace( | ||
439 | 396 | @@ -4538,6 +4671,7 @@ | ||
440 | 342 | { | 397 | { |
441 | 343 | fil_space_t* fnamespace; | 398 | fil_space_t* fnamespace; |
442 | 344 | fil_space_t* space; | 399 | fil_space_t* space; |
443 | @@ -346,7 +401,7 @@ | |||
444 | 346 | 401 | ||
445 | 347 | ut_ad(fil_system); | 402 | ut_ad(fil_system); |
446 | 348 | 403 | ||
448 | 349 | @@ -4615,6 +4740,10 @@ | 404 | @@ -4615,6 +4749,10 @@ |
449 | 350 | if (fnamespace == NULL) { | 405 | if (fnamespace == NULL) { |
450 | 351 | if (print_error_if_does_not_exist) { | 406 | if (print_error_if_does_not_exist) { |
451 | 352 | fil_report_missing_tablespace(name, id); | 407 | fil_report_missing_tablespace(name, id); |
452 | @@ -357,7 +412,7 @@ | |||
453 | 357 | } | 412 | } |
454 | 358 | } else { | 413 | } else { |
455 | 359 | ut_print_timestamp(stderr); | 414 | ut_print_timestamp(stderr); |
457 | 360 | @@ -4638,6 +4767,10 @@ | 415 | @@ -4638,6 +4776,10 @@ |
458 | 361 | 416 | ||
459 | 362 | mutex_exit(&fil_system->mutex); | 417 | mutex_exit(&fil_system->mutex); |
460 | 363 | 418 | ||
461 | @@ -368,7 +423,7 @@ | |||
462 | 368 | return(FALSE); | 423 | return(FALSE); |
463 | 369 | } | 424 | } |
464 | 370 | 425 | ||
466 | 371 | @@ -4728,6 +4861,7 @@ | 426 | @@ -4728,6 +4870,7 @@ |
467 | 372 | ulint page_size; | 427 | ulint page_size; |
468 | 373 | ulint pages_added; | 428 | ulint pages_added; |
469 | 374 | ibool success; | 429 | ibool success; |
470 | @@ -376,7 +431,7 @@ | |||
471 | 376 | 431 | ||
472 | 377 | ut_ad(!srv_read_only_mode); | 432 | ut_ad(!srv_read_only_mode); |
473 | 378 | 433 | ||
475 | 379 | @@ -4772,13 +4906,17 @@ | 434 | @@ -4772,13 +4915,17 @@ |
476 | 380 | goto retry; | 435 | goto retry; |
477 | 381 | } | 436 | } |
478 | 382 | 437 | ||
479 | @@ -395,7 +450,7 @@ | |||
480 | 395 | start_page_no = space->size; | 450 | start_page_no = space->size; |
481 | 396 | file_start_page_no = space->size - node->size; | 451 | file_start_page_no = space->size - node->size; |
482 | 397 | 452 | ||
484 | 398 | @@ -5024,7 +5162,7 @@ | 453 | @@ -5024,7 +5171,7 @@ |
485 | 399 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys | 454 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
486 | 400 | mutex. */ | 455 | mutex. */ |
487 | 401 | static | 456 | static |
488 | @@ -404,7 +459,7 @@ | |||
489 | 404 | fil_node_prepare_for_io( | 459 | fil_node_prepare_for_io( |
490 | 405 | /*====================*/ | 460 | /*====================*/ |
491 | 406 | fil_node_t* node, /*!< in: file node */ | 461 | fil_node_t* node, /*!< in: file node */ |
493 | 407 | @@ -5044,9 +5182,12 @@ | 462 | @@ -5044,9 +5191,12 @@ |
494 | 408 | } | 463 | } |
495 | 409 | 464 | ||
496 | 410 | if (node->open == FALSE) { | 465 | if (node->open == FALSE) { |
497 | @@ -418,7 +473,7 @@ | |||
498 | 418 | } | 473 | } |
499 | 419 | 474 | ||
500 | 420 | if (node->n_pending == 0 && fil_space_belongs_in_lru(space)) { | 475 | if (node->n_pending == 0 && fil_space_belongs_in_lru(space)) { |
502 | 421 | @@ -5058,6 +5199,8 @@ | 476 | @@ -5058,6 +5208,8 @@ |
503 | 422 | } | 477 | } |
504 | 423 | 478 | ||
505 | 424 | node->n_pending++; | 479 | node->n_pending++; |
506 | @@ -427,7 +482,7 @@ | |||
507 | 427 | } | 482 | } |
508 | 428 | 483 | ||
509 | 429 | /********************************************************************//** | 484 | /********************************************************************//** |
511 | 430 | @@ -5259,6 +5402,16 @@ | 485 | @@ -5259,6 +5411,16 @@ |
512 | 431 | 486 | ||
513 | 432 | ut_ad(mode != OS_AIO_IBUF || space->purpose == FIL_TABLESPACE); | 487 | ut_ad(mode != OS_AIO_IBUF || space->purpose == FIL_TABLESPACE); |
514 | 433 | 488 | ||
515 | @@ -444,7 +499,7 @@ | |||
516 | 444 | node = UT_LIST_GET_FIRST(space->chain); | 499 | node = UT_LIST_GET_FIRST(space->chain); |
517 | 445 | 500 | ||
518 | 446 | for (;;) { | 501 | for (;;) { |
520 | 447 | @@ -5290,7 +5443,11 @@ | 502 | @@ -5290,7 +5452,11 @@ |
521 | 448 | } | 503 | } |
522 | 449 | 504 | ||
523 | 450 | /* Open file if closed */ | 505 | /* Open file if closed */ |
524 | @@ -457,7 +512,7 @@ | |||
525 | 457 | 512 | ||
526 | 458 | /* Check that at least the start offset is within the bounds of a | 513 | /* Check that at least the start offset is within the bounds of a |
527 | 459 | single-table tablespace, including rollback tablespaces. */ | 514 | single-table tablespace, including rollback tablespaces. */ |
529 | 460 | @@ -6164,6 +6321,7 @@ | 515 | @@ -6164,6 +6330,7 @@ |
530 | 461 | return(err); | 516 | return(err); |
531 | 462 | } | 517 | } |
532 | 463 | 518 | ||
533 | @@ -465,7 +520,7 @@ | |||
534 | 465 | /****************************************************************//** | 520 | /****************************************************************//** |
535 | 466 | Generate redo logs for swapping two .ibd files */ | 521 | Generate redo logs for swapping two .ibd files */ |
536 | 467 | UNIV_INTERN | 522 | UNIV_INTERN |
538 | 468 | @@ -6187,4 +6345,4 @@ | 523 | @@ -6187,4 +6354,4 @@ |
539 | 469 | 0, 0, new_name, old_name, &mtr); | 524 | 0, 0, new_name, old_name, &mtr); |
540 | 470 | mtr_commit(&mtr); | 525 | mtr_commit(&mtr); |
541 | 471 | } | 526 | } |
542 | @@ -482,6 +537,107 @@ | |||
543 | 482 | 537 | ||
544 | 483 | if (thd && thd_sql_command(thd) == SQLCOM_DROP_TABLE) { | 538 | if (thd && thd_sql_command(thd) == SQLCOM_DROP_TABLE) { |
545 | 484 | 539 | ||
546 | 540 | @@ -2423,43 +2423,19 @@ | ||
547 | 541 | ulint buflen, /*!< in: length of buf, in bytes */ | ||
548 | 542 | const char* id, /*!< in: identifier to convert */ | ||
549 | 543 | ulint idlen, /*!< in: length of id, in bytes */ | ||
550 | 544 | - THD* thd, /*!< in: MySQL connection thread, or NULL */ | ||
551 | 545 | - ibool file_id)/*!< in: TRUE=id is a table or database name; | ||
552 | 546 | + THD* thd __attribute__((unused)), | ||
553 | 547 | + /*!< in: MySQL connection thread, or NULL */ | ||
554 | 548 | + ibool file_id __attribute__((unused))) | ||
555 | 549 | + /*!< in: TRUE=id is a table or database name; | ||
556 | 550 | FALSE=id is an UTF-8 string */ | ||
557 | 551 | { | ||
558 | 552 | - char nz[NAME_LEN + 1]; | ||
559 | 553 | - char nz2[NAME_LEN + 1 + EXPLAIN_FILENAME_MAX_EXTRA_LENGTH]; | ||
560 | 554 | - | ||
561 | 555 | const char* s = id; | ||
562 | 556 | int q; | ||
563 | 557 | |||
564 | 558 | - if (file_id) { | ||
565 | 559 | - /* Decode the table name. The MySQL function expects | ||
566 | 560 | - a NUL-terminated string. The input and output strings | ||
567 | 561 | - buffers must not be shared. */ | ||
568 | 562 | - | ||
569 | 563 | - if (UNIV_UNLIKELY(idlen > (sizeof nz) - 1)) { | ||
570 | 564 | - idlen = (sizeof nz) - 1; | ||
571 | 565 | - } | ||
572 | 566 | - | ||
573 | 567 | - memcpy(nz, id, idlen); | ||
574 | 568 | - nz[idlen] = 0; | ||
575 | 569 | - | ||
576 | 570 | - s = nz2; | ||
577 | 571 | - idlen = explain_filename(thd, nz, nz2, sizeof nz2, | ||
578 | 572 | - EXPLAIN_PARTITIONS_AS_COMMENT); | ||
579 | 573 | - goto no_quote; | ||
580 | 574 | - } | ||
581 | 575 | - | ||
582 | 576 | /* See if the identifier needs to be quoted. */ | ||
583 | 577 | - if (UNIV_UNLIKELY(!thd)) { | ||
584 | 578 | - q = '"'; | ||
585 | 579 | - } else { | ||
586 | 580 | - q = get_quote_char_for_identifier(thd, s, (int) idlen); | ||
587 | 581 | - } | ||
588 | 582 | + q = '"'; | ||
589 | 583 | |||
590 | 584 | if (q == EOF) { | ||
591 | 585 | -no_quote: | ||
592 | 586 | if (UNIV_UNLIKELY(idlen > buflen)) { | ||
593 | 587 | idlen = buflen; | ||
594 | 588 | } | ||
595 | 589 | @@ -16642,45 +16618,21 @@ | ||
596 | 590 | void | ||
597 | 591 | ib_logf( | ||
598 | 592 | /*====*/ | ||
599 | 593 | - ib_log_level_t level, /*!< in: warning level */ | ||
600 | 594 | + ib_log_level_t level __attribute__((unused)), | ||
601 | 595 | + /*!< in: warning level */ | ||
602 | 596 | const char* format, /*!< printf format */ | ||
603 | 597 | ...) /*!< Args */ | ||
604 | 598 | { | ||
605 | 599 | - char* str; | ||
606 | 600 | va_list args; | ||
607 | 601 | |||
608 | 602 | va_start(args, format); | ||
609 | 603 | |||
610 | 604 | -#ifdef __WIN__ | ||
611 | 605 | - int size = _vscprintf(format, args) + 1; | ||
612 | 606 | - str = static_cast<char*>(malloc(size)); | ||
613 | 607 | - str[size - 1] = 0x0; | ||
614 | 608 | - vsnprintf(str, size, format, args); | ||
615 | 609 | -#elif HAVE_VASPRINTF | ||
616 | 610 | - (void) vasprintf(&str, format, args); | ||
617 | 611 | -#else | ||
618 | 612 | - /* Use a fixed length string. */ | ||
619 | 613 | - str = static_cast<char*>(malloc(BUFSIZ)); | ||
620 | 614 | - my_vsnprintf(str, BUFSIZ, format, args); | ||
621 | 615 | -#endif /* __WIN__ */ | ||
622 | 616 | - | ||
623 | 617 | - switch(level) { | ||
624 | 618 | - case IB_LOG_LEVEL_INFO: | ||
625 | 619 | - sql_print_information("InnoDB: %s", str); | ||
626 | 620 | - break; | ||
627 | 621 | - case IB_LOG_LEVEL_WARN: | ||
628 | 622 | - sql_print_warning("InnoDB: %s", str); | ||
629 | 623 | - break; | ||
630 | 624 | - case IB_LOG_LEVEL_ERROR: | ||
631 | 625 | - sql_print_error("InnoDB: %s", str); | ||
632 | 626 | - break; | ||
633 | 627 | - case IB_LOG_LEVEL_FATAL: | ||
634 | 628 | - sql_print_error("InnoDB: %s", str); | ||
635 | 629 | - break; | ||
636 | 630 | - } | ||
637 | 631 | + /* Don't use server logger for XtraBackup, just print to stderr. */ | ||
638 | 632 | + vfprintf(stderr, format, args); | ||
639 | 633 | |||
640 | 634 | va_end(args); | ||
641 | 635 | - free(str); | ||
642 | 636 | + | ||
643 | 637 | + fputc('\n', stderr); | ||
644 | 638 | |||
645 | 639 | if (level == IB_LOG_LEVEL_FATAL) { | ||
646 | 640 | ut_error; | ||
647 | 485 | --- a/storage/innobase/include/srv0srv.h | 641 | --- a/storage/innobase/include/srv0srv.h |
648 | 486 | +++ b/storage/innobase/include/srv0srv.h | 642 | +++ b/storage/innobase/include/srv0srv.h |
649 | 487 | @@ -353,6 +353,9 @@ | 643 | @@ -353,6 +353,9 @@ |
650 | @@ -676,7 +832,60 @@ | |||
651 | 676 | dberr_t | 832 | dberr_t |
652 | 677 | open_or_create_data_files( | 833 | open_or_create_data_files( |
653 | 678 | /*======================*/ | 834 | /*======================*/ |
655 | 679 | @@ -2065,11 +2065,13 @@ | 835 | @@ -1204,12 +1204,16 @@ |
656 | 836 | /******************************************************************** | ||
657 | 837 | Opens the configured number of undo tablespaces. | ||
658 | 838 | @return DB_SUCCESS or error code */ | ||
659 | 839 | -static | ||
660 | 840 | +UNIV_INTERN | ||
661 | 841 | dberr_t | ||
662 | 842 | srv_undo_tablespaces_init( | ||
663 | 843 | /*======================*/ | ||
664 | 844 | ibool create_new_db, /*!< in: TRUE if new db being | ||
665 | 845 | created */ | ||
666 | 846 | + ibool backup_mode, /*!< in: TRUE disables reading | ||
667 | 847 | + the system tablespace (used in | ||
668 | 848 | + XtraBackup), FALSE is passed on | ||
669 | 849 | + recovery. */ | ||
670 | 850 | const ulint n_conf_tablespaces, /*!< in: configured undo | ||
671 | 851 | tablespaces */ | ||
672 | 852 | ulint* n_opened) /*!< out: number of UNDO | ||
673 | 853 | @@ -1225,6 +1229,7 @@ | ||
674 | 854 | *n_opened = 0; | ||
675 | 855 | |||
676 | 856 | ut_a(n_conf_tablespaces <= TRX_SYS_N_RSEGS); | ||
677 | 857 | + ut_a(!create_new_db || !backup_mode); | ||
678 | 858 | |||
679 | 859 | memset(undo_tablespace_ids, 0x0, sizeof(undo_tablespace_ids)); | ||
680 | 860 | |||
681 | 861 | @@ -1258,12 +1263,13 @@ | ||
682 | 862 | } | ||
683 | 863 | } | ||
684 | 864 | |||
685 | 865 | - /* Get the tablespace ids of all the undo segments excluding | ||
686 | 866 | - the system tablespace (0). If we are creating a new instance then | ||
687 | 867 | + /* Get the tablespace ids of all the undo segments excluding the system | ||
688 | 868 | + tablespace (0). If we are creating a new instance then | ||
689 | 869 | we build the undo_tablespace_ids ourselves since they don't | ||
690 | 870 | - already exist. */ | ||
691 | 871 | + already exist. If we are in the backup mode, don't read the trx header, | ||
692 | 872 | + we just need to add all available undo tablespaces to fil_system. */ | ||
693 | 873 | |||
694 | 874 | - if (!create_new_db) { | ||
695 | 875 | + if (!create_new_db && !backup_mode) { | ||
696 | 876 | n_undo_tablespaces = trx_rseg_get_n_undo_tablespaces( | ||
697 | 877 | undo_tablespace_ids); | ||
698 | 878 | } else { | ||
699 | 879 | @@ -1369,7 +1375,7 @@ | ||
700 | 880 | ib_logf(IB_LOG_LEVEL_INFO, "Opened %lu undo tablespaces", | ||
701 | 881 | n_undo_tablespaces); | ||
702 | 882 | |||
703 | 883 | - if (n_conf_tablespaces == 0) { | ||
704 | 884 | + if (n_conf_tablespaces == 0 && !backup_mode) { | ||
705 | 885 | ib_logf(IB_LOG_LEVEL_WARN, | ||
706 | 886 | "Using the system tablespace for all UNDO " | ||
707 | 887 | "logging because innodb_undo_tablespaces=0"); | ||
708 | 888 | @@ -2065,11 +2071,13 @@ | ||
709 | 680 | max_flushed_lsn = min_flushed_lsn | 889 | max_flushed_lsn = min_flushed_lsn |
710 | 681 | = log_get_lsn(); | 890 | = log_get_lsn(); |
711 | 682 | goto files_checked; | 891 | goto files_checked; |
712 | @@ -690,7 +899,15 @@ | |||
713 | 690 | } | 899 | } |
714 | 691 | 900 | ||
715 | 692 | /* opened all files */ | 901 | /* opened all files */ |
717 | 693 | @@ -2326,6 +2328,10 @@ | 902 | @@ -2162,6 +2170,7 @@ |
718 | 903 | |||
719 | 904 | err = srv_undo_tablespaces_init( | ||
720 | 905 | create_new_db, | ||
721 | 906 | + FALSE, | ||
722 | 907 | srv_undo_tablespaces, | ||
723 | 908 | &srv_undo_tablespaces_open); | ||
724 | 909 | |||
725 | 910 | @@ -2326,6 +2335,10 @@ | ||
726 | 694 | 911 | ||
727 | 695 | recv_recovery_from_checkpoint_finish(); | 912 | recv_recovery_from_checkpoint_finish(); |
728 | 696 | 913 | ||
729 | @@ -701,7 +918,7 @@ | |||
730 | 701 | if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) { | 918 | if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) { |
731 | 702 | /* The following call is necessary for the insert | 919 | /* The following call is necessary for the insert |
732 | 703 | buffer to work with multiple tablespaces. We must | 920 | buffer to work with multiple tablespaces. We must |
734 | 704 | @@ -2647,6 +2653,7 @@ | 921 | @@ -2647,6 +2660,7 @@ |
735 | 705 | && srv_auto_extend_last_data_file | 922 | && srv_auto_extend_last_data_file |
736 | 706 | && sum_of_data_file_sizes < tablespace_size_in_header) { | 923 | && sum_of_data_file_sizes < tablespace_size_in_header) { |
737 | 707 | 924 | ||
738 | @@ -709,7 +926,7 @@ | |||
739 | 709 | ut_print_timestamp(stderr); | 926 | ut_print_timestamp(stderr); |
740 | 710 | fprintf(stderr, | 927 | fprintf(stderr, |
741 | 711 | " InnoDB: Error: tablespace size stored in header" | 928 | " InnoDB: Error: tablespace size stored in header" |
743 | 712 | @@ -2683,6 +2690,7 @@ | 929 | @@ -2683,6 +2697,7 @@ |
744 | 713 | 930 | ||
745 | 714 | return(DB_ERROR); | 931 | return(DB_ERROR); |
746 | 715 | } | 932 | } |
747 | @@ -717,7 +934,7 @@ | |||
748 | 717 | } | 934 | } |
749 | 718 | 935 | ||
750 | 719 | /* Check that os_fast_mutexes work as expected */ | 936 | /* Check that os_fast_mutexes work as expected */ |
752 | 720 | @@ -2739,6 +2747,7 @@ | 937 | @@ -2739,6 +2754,7 @@ |
753 | 721 | fts_optimize_init(); | 938 | fts_optimize_init(); |
754 | 722 | } | 939 | } |
755 | 723 | 940 | ||
756 | @@ -725,7 +942,7 @@ | |||
757 | 725 | srv_was_started = TRUE; | 942 | srv_was_started = TRUE; |
758 | 726 | 943 | ||
759 | 727 | return(DB_SUCCESS); | 944 | return(DB_SUCCESS); |
761 | 728 | @@ -2794,7 +2803,7 @@ | 945 | @@ -2794,7 +2810,7 @@ |
762 | 729 | return(DB_SUCCESS); | 946 | return(DB_SUCCESS); |
763 | 730 | } | 947 | } |
764 | 731 | 948 | ||
765 | @@ -844,3 +1061,41 @@ | |||
766 | 844 | 1061 | ||
767 | 845 | UNIV_MEM_FREE(buf, n); | 1062 | UNIV_MEM_FREE(buf, n); |
768 | 846 | } | 1063 | } |
769 | 1064 | --- a/storage/innobase/include/fil0fil.h | ||
770 | 1065 | +++ b/storage/innobase/include/fil0fil.h | ||
771 | 1066 | @@ -163,6 +163,9 @@ | ||
772 | 1067 | #define FIL_LOG 502 /*!< redo log */ | ||
773 | 1068 | /* @} */ | ||
774 | 1069 | |||
775 | 1070 | +/** Determine if (i) is a user tablespace id or not. */ | ||
776 | 1071 | +#define fil_is_user_tablespace_id(i) ((i) > srv_undo_tablespaces_open) | ||
777 | 1072 | + | ||
778 | 1073 | /** The number of fsyncs done to the log */ | ||
779 | 1074 | extern ulint fil_n_log_flushes; | ||
780 | 1075 | |||
781 | 1076 | --- a/storage/innobase/include/srv0start.h | ||
782 | 1077 | +++ b/storage/innobase/include/srv0start.h | ||
783 | 1078 | @@ -77,6 +77,23 @@ | ||
784 | 1079 | srv_add_path_separator_if_needed( | ||
785 | 1080 | /*=============================*/ | ||
786 | 1081 | char* str); /*!< in: null-terminated character string */ | ||
787 | 1082 | +/******************************************************************** | ||
788 | 1083 | +Opens the configured number of undo tablespaces. | ||
789 | 1084 | +@return DB_SUCCESS or error code */ | ||
790 | 1085 | +UNIV_INTERN | ||
791 | 1086 | +dberr_t | ||
792 | 1087 | +srv_undo_tablespaces_init( | ||
793 | 1088 | +/*======================*/ | ||
794 | 1089 | + ibool create_new_db, /*!< in: TRUE if new db being | ||
795 | 1090 | + created */ | ||
796 | 1091 | + ibool backup_mode, /*!< in: TRUE disables reading | ||
797 | 1092 | + the system tablespace (used in | ||
798 | 1093 | + XtraBackup), FALSE is passed on | ||
799 | 1094 | + recovery. */ | ||
800 | 1095 | + const ulint n_conf_tablespaces, /*!< in: configured undo | ||
801 | 1096 | + tablespaces */ | ||
802 | 1097 | + ulint* n_opened); /*!< out: number of UNDO | ||
803 | 1098 | + tablespaces successfully */ | ||
804 | 1099 | #ifndef UNIV_HOTBACKUP | ||
805 | 1100 | /****************************************************************//** | ||
806 | 1101 | Starts Innobase and creates a new database if database files | ||
807 | 847 | 1102 | ||
808 | === modified file 'src/xtrabackup.cc' | |||
809 | --- src/xtrabackup.cc 2013-04-17 07:50:37 +0000 | |||
810 | +++ src/xtrabackup.cc 2013-04-23 10:01:01 +0000 | |||
811 | @@ -286,10 +286,8 @@ | |||
812 | 286 | 286 | ||
813 | 287 | #ifdef __WIN__ | 287 | #ifdef __WIN__ |
814 | 288 | #define SRV_PATH_SEPARATOR '\\' | 288 | #define SRV_PATH_SEPARATOR '\\' |
815 | 289 | #define SRV_PATH_SEPARATOR_STR "\\" | ||
816 | 290 | #else | 289 | #else |
817 | 291 | #define SRV_PATH_SEPARATOR '/' | 290 | #define SRV_PATH_SEPARATOR '/' |
818 | 292 | #define SRV_PATH_SEPARATOR_STR "/" | ||
819 | 293 | #endif | 291 | #endif |
820 | 294 | 292 | ||
821 | 295 | #ifndef UNIV_PAGE_SIZE_MAX | 293 | #ifndef UNIV_PAGE_SIZE_MAX |
822 | @@ -1643,6 +1641,7 @@ | |||
823 | 1643 | OPT_XTRA_DEBUG_SYNC, | 1641 | OPT_XTRA_DEBUG_SYNC, |
824 | 1644 | #if MYSQL_VERSION_ID >= 50600 | 1642 | #if MYSQL_VERSION_ID >= 50600 |
825 | 1645 | OPT_INNODB_CHECKSUM_ALGORITHM, | 1643 | OPT_INNODB_CHECKSUM_ALGORITHM, |
826 | 1644 | OPT_INNODB_UNDO_DIRECTORY, | ||
827 | 1646 | OPT_UNDO_TABLESPACES, | 1645 | OPT_UNDO_TABLESPACES, |
828 | 1647 | #endif | 1646 | #endif |
829 | 1648 | OPT_DEFAULTS_GROUP | 1647 | OPT_DEFAULTS_GROUP |
830 | @@ -1962,14 +1961,17 @@ | |||
831 | 1962 | 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, | 1961 | 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
832 | 1963 | #endif | 1962 | #endif |
833 | 1964 | #if MYSQL_VERSION_ID >= 50600 | 1963 | #if MYSQL_VERSION_ID >= 50600 |
835 | 1965 | {"checksum-algorithm", OPT_INNODB_CHECKSUM_ALGORITHM, | 1964 | {"innodb_checksum_algorithm", OPT_INNODB_CHECKSUM_ALGORITHM, |
836 | 1966 | "The algorithm InnoDB uses for page checksumming. [CRC32, STRICT_CRC32, " | 1965 | "The algorithm InnoDB uses for page checksumming. [CRC32, STRICT_CRC32, " |
837 | 1967 | "INNODB, STRICT_INNODB, NONE, STRICT_NONE]", &srv_checksum_algorithm, | 1966 | "INNODB, STRICT_INNODB, NONE, STRICT_NONE]", &srv_checksum_algorithm, |
838 | 1968 | &srv_checksum_algorithm, &innodb_checksum_algorithm_typelib, GET_ENUM, | 1967 | &srv_checksum_algorithm, &innodb_checksum_algorithm_typelib, GET_ENUM, |
839 | 1969 | REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, | 1968 | REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
843 | 1970 | {"undo-tablespaces", OPT_UNDO_TABLESPACES, | 1969 | {"innodb_undo_directory", OPT_INNODB_UNDO_DIRECTORY, |
844 | 1971 | "Number of undo tablespaces to use. NON-ZERO VALUES ARE NOT " | 1970 | "Directory where undo tablespace files live, this path can be absolute.", |
845 | 1972 | "CURRENTLY SUPPORTED", | 1971 | (G_PTR*) &srv_undo_dir, (G_PTR*) &srv_undo_dir, |
846 | 1972 | 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, | ||
847 | 1973 | {"innodb_undo_tablespaces", OPT_UNDO_TABLESPACES, | ||
848 | 1974 | "Number of undo tablespaces to use.", | ||
849 | 1973 | (G_PTR*)&srv_undo_tablespaces, (G_PTR*)&srv_undo_tablespaces, | 1975 | (G_PTR*)&srv_undo_tablespaces, (G_PTR*)&srv_undo_tablespaces, |
850 | 1974 | 0, GET_ULONG, REQUIRED_ARG, 0, 0, 126, 0, 1, 0}, | 1976 | 0, GET_ULONG, REQUIRED_ARG, 0, 0, 126, 0, 1, 0}, |
851 | 1975 | #endif | 1977 | #endif |
852 | @@ -3066,7 +3068,7 @@ | |||
853 | 3066 | char *p; | 3068 | char *p; |
854 | 3067 | 3069 | ||
855 | 3068 | p = srv_data_file_names[i]; | 3070 | p = srv_data_file_names[i]; |
857 | 3069 | while ((p = strstr(p, SRV_PATH_SEPARATOR_STR)) != NULL) | 3071 | while ((p = strchr(p, SRV_PATH_SEPARATOR)) != NULL) |
858 | 3070 | { | 3072 | { |
859 | 3071 | p++; | 3073 | p++; |
860 | 3072 | srv_data_file_names[i] = p; | 3074 | srv_data_file_names[i] = p; |
861 | @@ -3152,7 +3154,7 @@ | |||
862 | 3152 | srv_log_file_size = (ulint) innobase_log_file_size; | 3154 | srv_log_file_size = (ulint) innobase_log_file_size; |
863 | 3153 | msg("xtrabackup: innodb_log_files_in_group = %ld\n", | 3155 | msg("xtrabackup: innodb_log_files_in_group = %ld\n", |
864 | 3154 | srv_n_log_files); | 3156 | srv_n_log_files); |
866 | 3155 | msg("xtrabackup: innodb_log_file_size = %ld\n", | 3157 | msg("xtrabackup: innodb_log_file_size = %lld\n", |
867 | 3156 | srv_log_file_size); | 3158 | srv_log_file_size); |
868 | 3157 | 3159 | ||
869 | 3158 | #ifdef UNIV_LOG_ARCHIVE | 3160 | #ifdef UNIV_LOG_ARCHIVE |
870 | @@ -3308,6 +3310,18 @@ | |||
871 | 3308 | #endif | 3310 | #endif |
872 | 3309 | #endif /* MYSQL_VERSION_ID */ | 3311 | #endif /* MYSQL_VERSION_ID */ |
873 | 3310 | 3312 | ||
874 | 3313 | #if MYSQL_VERSION_ID >= 50600 | ||
875 | 3314 | /* Assign the default value to srv_undo_dir if it's not specified, as | ||
876 | 3315 | my_getopt does not support default values for string options. We also | ||
877 | 3316 | ignore the option and override innodb_undo_directory on --prepare, | ||
878 | 3317 | because separate undo tablespaces are copied to the root backup | ||
879 | 3318 | directory. */ | ||
880 | 3319 | |||
881 | 3320 | if (!srv_undo_dir || !xtrabackup_backup) { | ||
882 | 3321 | srv_undo_dir = (char *) "."; | ||
883 | 3322 | } | ||
884 | 3323 | #endif | ||
885 | 3324 | |||
886 | 3311 | return(FALSE); | 3325 | return(FALSE); |
887 | 3312 | 3326 | ||
888 | 3313 | error: | 3327 | error: |
889 | @@ -3590,26 +3604,26 @@ | |||
890 | 3590 | } | 3604 | } |
891 | 3591 | 3605 | ||
892 | 3592 | /************************************************************************ | 3606 | /************************************************************************ |
895 | 3593 | Checks if a table specified as a path should be skipped from backup | 3607 | Checks if a table specified as a name in the form "database/name" (InnoDB 5.6) |
896 | 3594 | based on the --tables or --tables-file options. | 3608 | or "./database/name.ibd" (InnoDB 5.5-) should be skipped from backup based on |
897 | 3609 | the --tables or --tables-file options. | ||
898 | 3595 | 3610 | ||
899 | 3596 | @return TRUE if the table should be skipped. */ | 3611 | @return TRUE if the table should be skipped. */ |
900 | 3597 | static my_bool | 3612 | static my_bool |
902 | 3598 | check_if_skip_table(const char *path, const char *suffix) | 3613 | check_if_skip_table(const char *name) |
903 | 3599 | { | 3614 | { |
904 | 3600 | char buf[FN_REFLEN]; | 3615 | char buf[FN_REFLEN]; |
905 | 3601 | const char *dbname, *tbname; | 3616 | const char *dbname, *tbname; |
906 | 3602 | const char *ptr; | 3617 | const char *ptr; |
907 | 3603 | char *eptr; | 3618 | char *eptr; |
908 | 3604 | int dbname_len; | ||
909 | 3605 | 3619 | ||
910 | 3606 | if (xtrabackup_tables == NULL && xtrabackup_tables_file == NULL) { | 3620 | if (xtrabackup_tables == NULL && xtrabackup_tables_file == NULL) { |
911 | 3607 | return(FALSE); | 3621 | return(FALSE); |
912 | 3608 | } | 3622 | } |
913 | 3609 | 3623 | ||
914 | 3610 | dbname = NULL; | 3624 | dbname = NULL; |
917 | 3611 | tbname = path; | 3625 | tbname = name; |
918 | 3612 | while ((ptr = strstr(tbname, SRV_PATH_SEPARATOR_STR)) != NULL) { | 3626 | while ((ptr = strchr(tbname, SRV_PATH_SEPARATOR)) != NULL) { |
919 | 3613 | dbname = tbname; | 3627 | dbname = tbname; |
920 | 3614 | tbname = ptr + 1; | 3628 | tbname = ptr + 1; |
921 | 3615 | } | 3629 | } |
922 | @@ -3619,14 +3633,16 @@ | |||
923 | 3619 | } | 3633 | } |
924 | 3620 | 3634 | ||
925 | 3621 | strncpy(buf, dbname, FN_REFLEN); | 3635 | strncpy(buf, dbname, FN_REFLEN); |
927 | 3622 | buf[FN_REFLEN - 1] = 0; | 3636 | buf[FN_REFLEN - 1] = '\0'; |
928 | 3623 | buf[tbname - 1 - dbname] = '.'; | 3637 | buf[tbname - 1 - dbname] = '.'; |
929 | 3624 | 3638 | ||
933 | 3625 | dbname_len = strlen(dbname) - strlen(suffix); | 3639 | /* Check if there's a suffix in the table name. If so, truncate it. We |
934 | 3626 | if (dbname_len < 1) { | 3640 | rely on the fact that a dot cannot be a part of a table name (it is |
935 | 3627 | return(FALSE); | 3641 | encoded by the server with the @NNNN syntax). */ |
936 | 3642 | if ((eptr = strchr(&buf[tbname - dbname], '.')) != NULL) { | ||
937 | 3643 | |||
938 | 3644 | *eptr = '\0'; | ||
939 | 3628 | } | 3645 | } |
940 | 3629 | buf[dbname_len - 1] = 0; | ||
941 | 3630 | 3646 | ||
942 | 3631 | /* For partitioned tables first try to match against the regexp | 3647 | /* For partitioned tables first try to match against the regexp |
943 | 3632 | without truncating the #P#... suffix so we can backup individual | 3648 | without truncating the #P#... suffix so we can backup individual |
944 | @@ -3747,7 +3763,11 @@ | |||
945 | 3747 | } | 3763 | } |
946 | 3748 | 3764 | ||
947 | 3749 | #ifndef XTRADB_BASED | 3765 | #ifndef XTRADB_BASED |
949 | 3750 | #define trx_sys_sys_space(id) (id == 0) | 3766 | # if MYSQL_VERSION_ID >= 50600 |
950 | 3767 | # define trx_sys_sys_space(id) (!fil_is_user_tablespace_id(id)) | ||
951 | 3768 | # else | ||
952 | 3769 | # define trx_sys_sys_space(id) (id == 0) | ||
953 | 3770 | # endif | ||
954 | 3751 | #endif | 3771 | #endif |
955 | 3752 | 3772 | ||
956 | 3753 | /****************************************************************//** | 3773 | /****************************************************************//** |
957 | @@ -3897,6 +3917,48 @@ | |||
958 | 3897 | } | 3917 | } |
959 | 3898 | #endif | 3918 | #endif |
960 | 3899 | 3919 | ||
961 | 3920 | /*********************************************************************** | ||
962 | 3921 | Extracts the relative path ("database/table.ibd") of a tablespace from a | ||
963 | 3922 | specified possibly absolute path. | ||
964 | 3923 | |||
965 | 3924 | For user tablespaces both "./database/table.ibd" and | ||
966 | 3925 | "/remote/dir/database/table.ibd" result in "database/table.ibd". | ||
967 | 3926 | |||
968 | 3927 | For system tablepsaces (i.e. When is_system is TRUE) both "/remote/dir/ibdata1" | ||
969 | 3928 | and "./ibdata1" yield "ibdata1" in the output. */ | ||
970 | 3929 | static | ||
971 | 3930 | const char * | ||
972 | 3931 | xb_get_relative_path( | ||
973 | 3932 | /*=================*/ | ||
974 | 3933 | const char* path, /*!< in: tablespace path (either | ||
975 | 3934 | relative or absolute) */ | ||
976 | 3935 | ibool is_system) /*!< in: TRUE for system tablespaces, | ||
977 | 3936 | i.e. when only the filename must be | ||
978 | 3937 | returned. */ | ||
979 | 3938 | { | ||
980 | 3939 | const char *next; | ||
981 | 3940 | const char *cur; | ||
982 | 3941 | const char *prev; | ||
983 | 3942 | |||
984 | 3943 | prev = NULL; | ||
985 | 3944 | cur = path; | ||
986 | 3945 | |||
987 | 3946 | while ((next = strchr(cur, SRV_PATH_SEPARATOR)) != NULL) { | ||
988 | 3947 | |||
989 | 3948 | prev = cur; | ||
990 | 3949 | cur = next + 1; | ||
991 | 3950 | } | ||
992 | 3951 | |||
993 | 3952 | if (is_system) { | ||
994 | 3953 | |||
995 | 3954 | return(cur); | ||
996 | 3955 | } else { | ||
997 | 3956 | |||
998 | 3957 | return((prev == NULL) ? cur : prev); | ||
999 | 3958 | } | ||
1000 | 3959 | |||
1001 | 3960 | } | ||
1002 | 3961 | |||
1003 | 3900 | /* TODO: We may tune the behavior (e.g. by fil_aio)*/ | 3962 | /* TODO: We may tune the behavior (e.g. by fil_aio)*/ |
1004 | 3901 | #define COPY_CHUNK 64 | 3963 | #define COPY_CHUNK 64 |
1005 | 3902 | 3964 | ||
1006 | @@ -3922,34 +3984,41 @@ | |||
1007 | 3922 | xb_delta_info_t info; | 3984 | xb_delta_info_t info; |
1008 | 3923 | datasink_t *ds = ds_ctxt->datasink; | 3985 | datasink_t *ds = ds_ctxt->datasink; |
1009 | 3924 | ds_file_t *dstfile = NULL; | 3986 | ds_file_t *dstfile = NULL; |
1010 | 3987 | ibool is_system; | ||
1011 | 3988 | |||
1012 | 3989 | /* Get the name and the path for the tablespace. node->name always | ||
1013 | 3990 | contains the path (which may be absolute for remote tablespaces in | ||
1014 | 3991 | 5.6+). space->name contains the tablespace name in the form | ||
1015 | 3992 | "./database/table.ibd" (in 5.5-) or "database/table" (in 5.6+). For a | ||
1016 | 3993 | multi-node shared tablespace, space->name contains the name of the first | ||
1017 | 3994 | node, but that's irrelevant, since we only need node_name to match them | ||
1018 | 3995 | against filters, and the shared tablespace is always copied regardless | ||
1019 | 3996 | of the filters value. */ | ||
1020 | 3997 | |||
1021 | 3998 | const char* const node_name = node->space->name; | ||
1022 | 3999 | const char* const node_path = node->name; | ||
1023 | 3925 | 4000 | ||
1024 | 3926 | info.page_size = 0; | 4001 | info.page_size = 0; |
1025 | 3927 | info.zip_size = 0; | 4002 | info.zip_size = 0; |
1026 | 3928 | info.space_id = 0; | 4003 | info.space_id = 0; |
1027 | 3929 | 4004 | ||
1031 | 3930 | if ((!trx_sys_sys_space(node->space->id)) | 4005 | is_system = trx_sys_sys_space(node->space->id); |
1032 | 3931 | && check_if_skip_table(node->name, "ibd")) { | 4006 | |
1033 | 3932 | msg("[%02u] Skipping %s.\n", thread_n, node->name); | 4007 | if (!is_system && check_if_skip_table(node_name)) { |
1034 | 4008 | msg("[%02u] Skipping %s.\n", thread_n, node_name); | ||
1035 | 3933 | return(FALSE); | 4009 | return(FALSE); |
1036 | 3934 | } | 4010 | } |
1037 | 3935 | 4011 | ||
1052 | 3936 | if (trx_sys_sys_space(node->space->id)) | 4012 | /* Get the relative path for the destination tablespace name. Non-system |
1053 | 3937 | { | 4013 | tablespaces may have absolute paths for remote tablespaces in MySQL |
1054 | 3938 | char *next, *p; | 4014 | 5.6+. We want to make "local" copies for the backup. We don't use |
1055 | 3939 | /* system datafile "/fullpath/datafilename.ibd" or "./datafilename.ibd" */ | 4015 | node_name here, because in MySQL 5.6+ it doesn't contain the .ibd |
1056 | 3940 | p = node->name; | 4016 | suffix */ |
1057 | 3941 | while ((next = strstr(p, SRV_PATH_SEPARATOR_STR)) != NULL) | 4017 | strncpy(dst_name, xb_get_relative_path(node_path, is_system), |
1058 | 3942 | { | 4018 | sizeof(dst_name)); |
1045 | 3943 | p = next + 1; | ||
1046 | 3944 | } | ||
1047 | 3945 | strncpy(dst_name, p, sizeof(dst_name)); | ||
1048 | 3946 | } else { | ||
1049 | 3947 | /* file per table style "./database/table.ibd" */ | ||
1050 | 3948 | strncpy(dst_name, node->name, sizeof(dst_name)); | ||
1051 | 3949 | } | ||
1059 | 3950 | 4019 | ||
1060 | 3951 | /* open src_file*/ | 4020 | /* open src_file*/ |
1062 | 3952 | src_file = xb_file_create_no_error_handling(node->name, | 4021 | src_file = xb_file_create_no_error_handling(node_path, |
1063 | 3953 | OS_FILE_OPEN, | 4022 | OS_FILE_OPEN, |
1064 | 3954 | OS_FILE_READ_ONLY, | 4023 | OS_FILE_READ_ONLY, |
1065 | 3955 | &success); | 4024 | &success); |
1066 | @@ -3961,11 +4030,11 @@ | |||
1067 | 3961 | "[%02u] xtrabackup: Warning: We assume the " | 4030 | "[%02u] xtrabackup: Warning: We assume the " |
1068 | 3962 | "table was dropped or renamed during " | 4031 | "table was dropped or renamed during " |
1069 | 3963 | "xtrabackup execution and ignore the file.\n", | 4032 | "xtrabackup execution and ignore the file.\n", |
1071 | 3964 | thread_n, node->name, thread_n); | 4033 | thread_n, node_path, thread_n); |
1072 | 3965 | goto skip; | 4034 | goto skip; |
1073 | 3966 | } | 4035 | } |
1074 | 3967 | 4036 | ||
1076 | 3968 | xb_file_set_nocache(src_file, node->name, "OPEN"); | 4037 | xb_file_set_nocache(src_file, node_path, "OPEN"); |
1077 | 3969 | 4038 | ||
1078 | 3970 | #ifdef USE_POSIX_FADVISE | 4039 | #ifdef USE_POSIX_FADVISE |
1079 | 3971 | posix_fadvise(src_file, 0, 0, POSIX_FADV_SEQUENTIAL); | 4040 | posix_fadvise(src_file, 0, 0, POSIX_FADV_SEQUENTIAL); |
1080 | @@ -3982,7 +4051,7 @@ | |||
1081 | 3982 | page_size = info.zip_size; | 4051 | page_size = info.zip_size; |
1082 | 3983 | page_size_shift = get_bit_shift(page_size); | 4052 | page_size_shift = get_bit_shift(page_size); |
1083 | 3984 | msg("[%02u] %s is compressed with page size = " | 4053 | msg("[%02u] %s is compressed with page size = " |
1085 | 3985 | "%lu bytes\n", thread_n, node->name, page_size); | 4054 | "%lu bytes\n", thread_n, node_name, page_size); |
1086 | 3986 | if (page_size_shift < 10 || page_size_shift > 14) { | 4055 | if (page_size_shift < 10 || page_size_shift > 14) { |
1087 | 3987 | msg("[%02u] xtrabackup: Error: Invalid " | 4056 | msg("[%02u] xtrabackup: Error: Invalid " |
1088 | 3988 | "page size: %lu.\n", thread_n, page_size); | 4057 | "page size: %lu.\n", thread_n, page_size); |
1089 | @@ -4019,9 +4088,9 @@ | |||
1090 | 4019 | } else | 4088 | } else |
1091 | 4020 | info.page_size = 0; | 4089 | info.page_size = 0; |
1092 | 4021 | 4090 | ||
1094 | 4022 | if (my_stat(node->name, &src_stat, MYF(MY_WME)) == NULL) { | 4091 | if (my_stat(node_path, &src_stat, MYF(MY_WME)) == NULL) { |
1095 | 4023 | msg("[%02u] xtrabackup: Warning: cannot stat %s\n", | 4092 | msg("[%02u] xtrabackup: Warning: cannot stat %s\n", |
1097 | 4024 | thread_n, node->name); | 4093 | thread_n, node_path); |
1098 | 4025 | goto skip; | 4094 | goto skip; |
1099 | 4026 | } | 4095 | } |
1100 | 4027 | dstfile = ds->open(ds_ctxt, dst_name, &src_stat); | 4096 | dstfile = ds->open(ds_ctxt, dst_name, &src_stat); |
1101 | @@ -4035,7 +4104,7 @@ | |||
1102 | 4035 | if (xtrabackup_stream) { | 4104 | if (xtrabackup_stream) { |
1103 | 4036 | const char *action = xtrabackup_compress ? | 4105 | const char *action = xtrabackup_compress ? |
1104 | 4037 | "Compressing and streaming" : "Streaming"; | 4106 | "Compressing and streaming" : "Streaming"; |
1106 | 4038 | msg("[%02u] %s %s\n", thread_n, action, node->name); | 4107 | msg("[%02u] %s %s\n", thread_n, action, node_path); |
1107 | 4039 | } else { | 4108 | } else { |
1108 | 4040 | const char *action; | 4109 | const char *action; |
1109 | 4041 | 4110 | ||
1110 | @@ -4045,7 +4114,7 @@ | |||
1111 | 4045 | action = "Copying"; | 4114 | action = "Copying"; |
1112 | 4046 | } | 4115 | } |
1113 | 4047 | msg("[%02u] %s %s to %s\n", thread_n, action, | 4116 | msg("[%02u] %s %s to %s\n", thread_n, action, |
1115 | 4048 | node->name, dstfile->path); | 4117 | node_path, dstfile->path); |
1116 | 4049 | } | 4118 | } |
1117 | 4050 | 4119 | ||
1118 | 4051 | buf2 = static_cast<byte *>(ut_malloc(COPY_CHUNK | 4120 | buf2 = static_cast<byte *>(ut_malloc(COPY_CHUNK |
1119 | @@ -4112,7 +4181,7 @@ | |||
1120 | 4112 | "resulted in fail. File " | 4181 | "resulted in fail. File " |
1121 | 4113 | "%s seems to be " | 4182 | "%s seems to be " |
1122 | 4114 | "corrupted.\n", | 4183 | "corrupted.\n", |
1124 | 4115 | thread_n, node->name); | 4184 | thread_n, node_path); |
1125 | 4116 | goto error; | 4185 | goto error; |
1126 | 4117 | } | 4186 | } |
1127 | 4118 | msg("[%02u] xtrabackup: " | 4187 | msg("[%02u] xtrabackup: " |
1128 | @@ -4237,8 +4306,8 @@ | |||
1129 | 4237 | msg("[%02u] xtrabackup: Warning: We assume the " | 4306 | msg("[%02u] xtrabackup: Warning: We assume the " |
1130 | 4238 | "table was dropped during xtrabackup execution " | 4307 | "table was dropped during xtrabackup execution " |
1131 | 4239 | "and ignore the file.\n", thread_n); | 4308 | "and ignore the file.\n", thread_n); |
1134 | 4240 | msg("[%02u] xtrabackup: Warning: skipping file %s.\n", | 4309 | msg("[%02u] xtrabackup: Warning: skipping tablespace %s.\n", |
1135 | 4241 | thread_n, node->name); | 4310 | thread_n, node_name); |
1136 | 4242 | return(FALSE); | 4311 | return(FALSE); |
1137 | 4243 | } | 4312 | } |
1138 | 4244 | 4313 | ||
1139 | @@ -4691,7 +4760,24 @@ | |||
1140 | 4691 | return(DB_ERROR); | 4760 | return(DB_ERROR); |
1141 | 4692 | } | 4761 | } |
1142 | 4693 | 4762 | ||
1144 | 4694 | return(fil_load_single_table_tablespaces()); | 4763 | err = fil_load_single_table_tablespaces(); |
1145 | 4764 | if (err != DB_SUCCESS) { | ||
1146 | 4765 | return(err); | ||
1147 | 4766 | } | ||
1148 | 4767 | |||
1149 | 4768 | #if MYSQL_VERSION_ID >= 50600 | ||
1150 | 4769 | /* Add separate undo tablespaces to fil_system */ | ||
1151 | 4770 | |||
1152 | 4771 | err = srv_undo_tablespaces_init(FALSE, | ||
1153 | 4772 | TRUE, | ||
1154 | 4773 | srv_undo_tablespaces, | ||
1155 | 4774 | &srv_undo_tablespaces_open); | ||
1156 | 4775 | if (err != DB_SUCCESS) { | ||
1157 | 4776 | return(err); | ||
1158 | 4777 | } | ||
1159 | 4778 | #endif | ||
1160 | 4779 | |||
1161 | 4780 | return(DB_SUCCESS); | ||
1162 | 4695 | } | 4781 | } |
1163 | 4696 | 4782 | ||
1164 | 4697 | /*********************************************************************//** | 4783 | /*********************************************************************//** |
1165 | @@ -6056,7 +6142,7 @@ | |||
1166 | 6056 | table = dict_table_get_low(table_name); | 6142 | table = dict_table_get_low(table_name); |
1167 | 6057 | mem_free(table_name); | 6143 | mem_free(table_name); |
1168 | 6058 | 6144 | ||
1170 | 6059 | if (table && check_if_skip_table(table->name, "")) | 6145 | if (table && check_if_skip_table(table->name)) |
1171 | 6060 | goto skip; | 6146 | goto skip; |
1172 | 6061 | 6147 | ||
1173 | 6062 | if (table == NULL) { | 6148 | if (table == NULL) { |
1174 | @@ -7454,7 +7540,9 @@ | |||
1175 | 7454 | 7540 | ||
1176 | 7455 | p = info_file_path; | 7541 | p = info_file_path; |
1177 | 7456 | prev = NULL; | 7542 | prev = NULL; |
1179 | 7457 | while ((next = strstr(p, SRV_PATH_SEPARATOR_STR)) != NULL) | 7543 | while ((next = |
1180 | 7544 | strchr(p, SRV_PATH_SEPARATOR)) | ||
1181 | 7545 | != NULL) | ||
1182 | 7458 | { | 7546 | { |
1183 | 7459 | prev = p; | 7547 | prev = p; |
1184 | 7460 | p = next + 1; | 7548 | p = next + 1; |
1185 | @@ -7895,6 +7983,14 @@ | |||
1186 | 7895 | printf("innodb_file_per_table = %d\n", | 7983 | printf("innodb_file_per_table = %d\n", |
1187 | 7896 | (int) innobase_file_per_table); | 7984 | (int) innobase_file_per_table); |
1188 | 7897 | #endif | 7985 | #endif |
1189 | 7986 | #if MYSQL_VERSION_ID >= 50600 | ||
1190 | 7987 | if (srv_undo_dir) { | ||
1191 | 7988 | |||
1192 | 7989 | printf("innodb_undo_directory = \"%s\"\n", | ||
1193 | 7990 | srv_undo_dir); | ||
1194 | 7991 | } | ||
1195 | 7992 | printf("innodb_undo_tablespaces = %lu\n", srv_undo_tablespaces); | ||
1196 | 7993 | #endif | ||
1197 | 7898 | exit(EXIT_SUCCESS); | 7994 | exit(EXIT_SUCCESS); |
1198 | 7899 | } | 7995 | } |
1199 | 7900 | 7996 | ||
1200 | 7901 | 7997 | ||
1201 | === modified file 'test/inc/common.sh' | |||
1202 | --- test/inc/common.sh 2013-03-08 04:37:16 +0000 | |||
1203 | +++ test/inc/common.sh 2013-04-23 10:01:01 +0000 | |||
1204 | @@ -27,25 +27,12 @@ | |||
1205 | 27 | exit 1 | 27 | exit 1 |
1206 | 28 | } | 28 | } |
1207 | 29 | 29 | ||
1209 | 30 | function init_mysql_dir() | 30 | function call_mysql_install_db() |
1210 | 31 | { | 31 | { |
1211 | 32 | if [ ! -d "$MYSQLD_VARDIR" ] | ||
1212 | 33 | then | ||
1213 | 34 | vlog "Creating server root directory: $MYSQLD_VARDIR" | ||
1214 | 35 | mkdir "$MYSQLD_VARDIR" | ||
1215 | 36 | fi | ||
1216 | 37 | if [ ! -d "$MYSQLD_TMPDIR" ] | ||
1217 | 38 | then | ||
1218 | 39 | vlog "Creating server temporary directory: $MYSQLD_TMPDIR" | ||
1219 | 40 | mkdir "$MYSQLD_TMPDIR" | ||
1220 | 41 | fi | ||
1221 | 42 | if [ ! -d "$MYSQLD_DATADIR" ] | ||
1222 | 43 | then | ||
1223 | 44 | vlog "Creating server data directory: $MYSQLD_DATADIR" | ||
1224 | 45 | mkdir -p "$MYSQLD_DATADIR" | ||
1225 | 46 | vlog "Calling mysql_install_db" | 32 | vlog "Calling mysql_install_db" |
1228 | 47 | $MYSQL_INSTALL_DB --no-defaults --basedir=$MYSQL_BASEDIR --datadir="$MYSQLD_DATADIR" --tmpdir="$MYSQLD_TMPDIR" ${MYSQLD_EXTRA_ARGS} | 33 | cd $MYSQL_BASEDIR |
1229 | 48 | fi | 34 | $MYSQL_INSTALL_DB --defaults-file=${MYSQLD_VARDIR}/my.cnf ${MYSQLD_EXTRA_ARGS} |
1230 | 35 | cd - | ||
1231 | 49 | } | 36 | } |
1232 | 50 | 37 | ||
1233 | 51 | ######################################################################## | 38 | ######################################################################## |
1234 | @@ -230,20 +217,15 @@ | |||
1235 | 230 | MYSQLD_PORT="${SRV_MYSQLD_PORT[$id]}" | 217 | MYSQLD_PORT="${SRV_MYSQLD_PORT[$id]}" |
1236 | 231 | MYSQLD_SOCKET="${SRV_MYSQLD_SOCKET[$id]}" | 218 | MYSQLD_SOCKET="${SRV_MYSQLD_SOCKET[$id]}" |
1237 | 232 | 219 | ||
1243 | 233 | MYSQL_ARGS="--no-defaults --socket=${MYSQLD_SOCKET} --user=root" | 220 | MYSQL_ARGS="--defaults-file=$MYSQLD_VARDIR/my.cnf " |
1244 | 234 | MYSQLD_ARGS="--no-defaults --basedir=${MYSQL_BASEDIR} \ | 221 | MYSQLD_ARGS="--defaults-file=$MYSQLD_VARDIR/my.cnf ${MYSQLD_EXTRA_ARGS}" |
1240 | 235 | --socket=${MYSQLD_SOCKET} --port=${MYSQLD_PORT} --server-id=$id \ | ||
1241 | 236 | --datadir=${MYSQLD_DATADIR} --tmpdir=${MYSQLD_TMPDIR} --log-bin=mysql-bin \ | ||
1242 | 237 | --relay-log=mysql-relay-bin --pid-file=${MYSQLD_PIDFILE} ${MYSQLD_EXTRA_ARGS}" | ||
1245 | 238 | if [ "`whoami`" = "root" ] | 222 | if [ "`whoami`" = "root" ] |
1246 | 239 | then | 223 | then |
1247 | 240 | MYSQLD_ARGS="$MYSQLD_ARGS --user=root" | 224 | MYSQLD_ARGS="$MYSQLD_ARGS --user=root" |
1248 | 241 | fi | 225 | fi |
1249 | 242 | 226 | ||
1254 | 243 | export MYSQL_HOME=$MYSQLD_VARDIR | 227 | IB_ARGS="--defaults-file=$MYSQLD_VARDIR/my.cnf --ibbackup=$XB_BIN" |
1255 | 244 | 228 | XB_ARGS="--defaults-file=$MYSQLD_VARDIR/my.cnf" | |
1252 | 245 | IB_ARGS="--user=root --socket=${MYSQLD_SOCKET} --ibbackup=$XB_BIN" | ||
1253 | 246 | XB_ARGS="--no-defaults" | ||
1256 | 247 | 229 | ||
1257 | 248 | # Some aliases for compatibility, as tests use the following names | 230 | # Some aliases for compatibility, as tests use the following names |
1258 | 249 | topdir="$MYSQLD_VARDIR" | 231 | topdir="$MYSQLD_VARDIR" |
1259 | @@ -265,14 +247,48 @@ | |||
1260 | 265 | init_server_variables $id | 247 | init_server_variables $id |
1261 | 266 | switch_server $id | 248 | switch_server $id |
1262 | 267 | 249 | ||
1264 | 268 | init_mysql_dir | 250 | if [ ! -d "$MYSQLD_VARDIR" ] |
1265 | 251 | then | ||
1266 | 252 | vlog "Creating server root directory: $MYSQLD_VARDIR" | ||
1267 | 253 | mkdir "$MYSQLD_VARDIR" | ||
1268 | 254 | fi | ||
1269 | 255 | if [ ! -d "$MYSQLD_TMPDIR" ] | ||
1270 | 256 | then | ||
1271 | 257 | vlog "Creating server temporary directory: $MYSQLD_TMPDIR" | ||
1272 | 258 | mkdir "$MYSQLD_TMPDIR" | ||
1273 | 259 | fi | ||
1274 | 260 | |||
1275 | 261 | # Create the configuration file used by mysql_install_db, the server | ||
1276 | 262 | # and the xtrabackup binary | ||
1277 | 269 | cat > ${MYSQLD_VARDIR}/my.cnf <<EOF | 263 | cat > ${MYSQLD_VARDIR}/my.cnf <<EOF |
1278 | 270 | [mysqld] | 264 | [mysqld] |
1279 | 265 | socket=${MYSQLD_SOCKET} | ||
1280 | 266 | port=${MYSQLD_PORT} | ||
1281 | 267 | server-id=$id | ||
1282 | 268 | basedir=${MYSQL_BASEDIR} | ||
1283 | 271 | datadir=${MYSQLD_DATADIR} | 269 | datadir=${MYSQLD_DATADIR} |
1284 | 272 | tmpdir=${MYSQLD_TMPDIR} | 270 | tmpdir=${MYSQLD_TMPDIR} |
1285 | 271 | log-bin=mysql-bin | ||
1286 | 272 | relay-log=mysql-relay-bin | ||
1287 | 273 | pid-file=${MYSQLD_PIDFILE} | ||
1288 | 274 | replicate-ignore-db=mysql | ||
1289 | 275 | ${MYSQLD_EXTRA_MY_CNF_OPTS:-} | ||
1290 | 276 | |||
1291 | 277 | [client] | ||
1292 | 278 | socket=${MYSQLD_SOCKET} | ||
1293 | 279 | user=root | ||
1294 | 273 | EOF | 280 | EOF |
1295 | 274 | 281 | ||
1296 | 282 | # Create datadir and call mysql_install_db if it doesn't exist | ||
1297 | 283 | if [ ! -d "$MYSQLD_DATADIR" ] | ||
1298 | 284 | then | ||
1299 | 285 | vlog "Creating server data directory: $MYSQLD_DATADIR" | ||
1300 | 286 | mkdir -p "$MYSQLD_DATADIR" | ||
1301 | 287 | call_mysql_install_db | ||
1302 | 288 | fi | ||
1303 | 289 | |||
1304 | 275 | # Start the server | 290 | # Start the server |
1305 | 291 | echo "Starting ${MYSQLD} ${MYSQLD_ARGS} $* " | ||
1306 | 276 | ${MYSQLD} ${MYSQLD_ARGS} $* & | 292 | ${MYSQLD} ${MYSQLD_ARGS} $* & |
1307 | 277 | if ! mysql_ping | 293 | if ! mysql_ping |
1308 | 278 | then | 294 | then |
1309 | @@ -301,6 +317,10 @@ | |||
1310 | 301 | vlog "Server PID file '${MYSQLD_PIDFILE}' doesn't exist!" | 317 | vlog "Server PID file '${MYSQLD_PIDFILE}' doesn't exist!" |
1311 | 302 | fi | 318 | fi |
1312 | 303 | 319 | ||
1313 | 320 | # Reset XB_ARGS so we can call xtrabackup in tests even without starting the | ||
1314 | 321 | # server | ||
1315 | 322 | XB_ARGS="--no-defaults" | ||
1316 | 323 | |||
1317 | 304 | # unlock the port number | 324 | # unlock the port number |
1318 | 305 | free_reserved_port $MYSQLD_PORT | 325 | free_reserved_port $MYSQLD_PORT |
1319 | 306 | 326 | ||
1320 | 307 | 327 | ||
1321 | === modified file 'test/inc/ib_part.sh' | |||
1322 | --- test/inc/ib_part.sh 2013-03-07 11:38:14 +0000 | |||
1323 | +++ test/inc/ib_part.sh 2013-04-23 10:01:01 +0000 | |||
1324 | @@ -2,15 +2,15 @@ | |||
1325 | 2 | 2 | ||
1326 | 3 | function check_partitioning() | 3 | function check_partitioning() |
1327 | 4 | { | 4 | { |
1329 | 5 | $MYSQL $MYSQL_ARGS -Ns -e "show variables like 'have_partitioning'" | 5 | $MYSQL $MYSQL_ARGS -Ns -e "SHOW PLUGINS" 2> /dev/null | |
1330 | 6 | egrep -q "^partition" | ||
1331 | 6 | } | 7 | } |
1332 | 7 | 8 | ||
1333 | 8 | function require_partitioning() | 9 | function require_partitioning() |
1334 | 9 | { | 10 | { |
1339 | 10 | PARTITION_CHECK=`check_partitioning` | 11 | if ! check_partitioning |
1340 | 11 | 12 | then | |
1341 | 12 | if [ -z "$PARTITION_CHECK" ]; then | 13 | echo "Requires support for partitioning." > $SKIPPED_REASON |
1338 | 13 | echo "Requires Partitioning." > $SKIPPED_REASON | ||
1342 | 14 | exit $SKIPPED_EXIT_CODE | 14 | exit $SKIPPED_EXIT_CODE |
1343 | 15 | fi | 15 | fi |
1344 | 16 | } | 16 | } |
1345 | 17 | 17 | ||
1346 | === modified file 'test/t/bug1062684.sh' | |||
1347 | --- test/t/bug1062684.sh 2013-03-08 04:37:16 +0000 | |||
1348 | +++ test/t/bug1062684.sh 2013-04-23 10:01:01 +0000 | |||
1349 | @@ -1,11 +1,18 @@ | |||
1351 | 1 | MYSQLD_EXTRA_ARGS=--innodb-data-file-path="ibdata1:${DEFAULT_IBDATA_SIZE};ibdata2:5M:autoextend" | 1 | ################################################################################ |
1352 | 2 | # Bug #1062684: Applying incremental backup using xtrabackup 2.0.3 fails when | ||
1353 | 3 | # innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend is | ||
1354 | 4 | # set in [mysqld] | ||
1355 | 5 | ################################################################################ | ||
1356 | 6 | |||
1357 | 2 | . inc/common.sh | 7 | . inc/common.sh |
1358 | 3 | 8 | ||
1360 | 4 | start_server --innodb-data-file-path="ibdata1:${DEFAULT_IBDATA_SIZE};ibdata2:5M:autoextend" | 9 | MYSQLD_EXTRA_MY_CNF_OPTS=" |
1361 | 10 | innodb-data-file-path=ibdata1:${DEFAULT_IBDATA_SIZE};ibdata2:5M:autoextend | ||
1362 | 11 | " | ||
1363 | 12 | |||
1364 | 13 | start_server | ||
1365 | 5 | load_dbase_schema incremental_sample | 14 | load_dbase_schema incremental_sample |
1366 | 6 | 15 | ||
1367 | 7 | echo "innodb-data-file-path=ibdata1:${DEFAULT_IBDATA_SIZE};ibdata2:5M:autoextend" >>$topdir/my.cnf | ||
1368 | 8 | |||
1369 | 9 | # Adding initial rows | 16 | # Adding initial rows |
1370 | 10 | vlog "Adding initial rows to database..." | 17 | vlog "Adding initial rows to database..." |
1371 | 11 | ${MYSQL} ${MYSQL_ARGS} -e "insert into test values (1, 1);" incremental_sample | 18 | ${MYSQL} ${MYSQL_ARGS} -e "insert into test values (1, 1);" incremental_sample |
1372 | 12 | 19 | ||
1373 | === modified file 'test/t/bug483827.sh' | |||
1374 | --- test/t/bug483827.sh 2012-06-05 12:35:33 +0000 | |||
1375 | +++ test/t/bug483827.sh 2013-04-23 10:01:01 +0000 | |||
1376 | @@ -18,10 +18,7 @@ | |||
1377 | 18 | modify_args | 18 | modify_args |
1378 | 19 | 19 | ||
1379 | 20 | # make my_multi.cnf | 20 | # make my_multi.cnf |
1384 | 21 | echo " | 21 | sed -e 's/\[mysqld\]/[mysqld1]/' $topdir/my.cnf > $topdir/my_multi.cnf |
1381 | 22 | [mysqld1] | ||
1382 | 23 | datadir=${mysql_datadir} | ||
1383 | 24 | tmpdir=$mysql_tmpdir" > $topdir/my_multi.cnf | ||
1385 | 25 | 22 | ||
1386 | 26 | # Backup | 23 | # Backup |
1387 | 27 | innobackupex --no-timestamp --defaults-group=mysqld1 $backup_dir | 24 | innobackupex --no-timestamp --defaults-group=mysqld1 $backup_dir |
1388 | 28 | 25 | ||
1389 | === modified file 'test/t/bug606981.sh' | |||
1390 | --- test/t/bug606981.sh 2012-06-19 06:00:44 +0000 | |||
1391 | +++ test/t/bug606981.sh 2013-04-23 10:01:01 +0000 | |||
1392 | @@ -6,12 +6,16 @@ | |||
1393 | 6 | exit $SKIPPED_EXIT_CODE | 6 | exit $SKIPPED_EXIT_CODE |
1394 | 7 | fi | 7 | fi |
1395 | 8 | 8 | ||
1397 | 9 | start_server --innodb_file_per_table | 9 | MYSQLD_EXTRA_MY_CNF_OPTS=" |
1398 | 10 | innodb_file_per_table=1 | ||
1399 | 11 | innodb_flush_method=O_DIRECT | ||
1400 | 12 | " | ||
1401 | 13 | |||
1402 | 14 | start_server | ||
1403 | 10 | 15 | ||
1404 | 11 | load_sakila | 16 | load_sakila |
1405 | 12 | 17 | ||
1406 | 13 | # Take backup | 18 | # Take backup |
1407 | 14 | echo "innodb_flush_method=O_DIRECT" >> $topdir/my.cnf | ||
1408 | 15 | mkdir -p $topdir/backup | 19 | mkdir -p $topdir/backup |
1409 | 16 | innobackupex --stream=tar $topdir/backup > $topdir/backup/out.tar | 20 | innobackupex --stream=tar $topdir/backup > $topdir/backup/out.tar |
1410 | 17 | stop_server | 21 | stop_server |
1411 | @@ -30,11 +34,11 @@ | |||
1412 | 30 | backup_dir=$topdir/backup | 34 | backup_dir=$topdir/backup |
1413 | 31 | cd $backup_dir | 35 | cd $backup_dir |
1414 | 32 | $TAR -ixvf out.tar | 36 | $TAR -ixvf out.tar |
1417 | 33 | cd - >/dev/null 2>&1 | 37 | cd - >/dev/null 2>&1 |
1418 | 34 | innobackupex --apply-log --defaults-file=$topdir/my.cnf $backup_dir | 38 | innobackupex --apply-log $backup_dir |
1419 | 35 | vlog "Restoring MySQL datadir" | 39 | vlog "Restoring MySQL datadir" |
1420 | 36 | mkdir -p $mysql_datadir | 40 | mkdir -p $mysql_datadir |
1422 | 37 | innobackupex --copy-back --defaults-file=$topdir/my.cnf $backup_dir | 41 | innobackupex --copy-back $backup_dir |
1423 | 38 | 42 | ||
1424 | 39 | start_server | 43 | start_server |
1425 | 40 | # Check sakila | 44 | # Check sakila |
1426 | 41 | 45 | ||
1427 | === modified file 'test/t/bug740489.sh' | |||
1428 | --- test/t/bug740489.sh 2013-01-07 19:14:19 +0000 | |||
1429 | +++ test/t/bug740489.sh 2013-04-23 10:01:01 +0000 | |||
1430 | @@ -6,26 +6,34 @@ | |||
1431 | 6 | start_server --innodb_file_per_table | 6 | start_server --innodb_file_per_table |
1432 | 7 | load_sakila | 7 | load_sakila |
1433 | 8 | 8 | ||
1446 | 9 | run_cmd ${MYSQL} ${MYSQL_ARGS} -e "UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; FLUSH PRIVILEGES;" | 9 | run_cmd ${MYSQL} ${MYSQL_ARGS} <<EOF |
1447 | 10 | 10 | SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password'); | |
1448 | 11 | defaults_extra_file=${TEST_BASEDIR}/740489.cnf | 11 | EOF |
1449 | 12 | 12 | ||
1450 | 13 | echo "[client]" > $defaults_extra_file | 13 | defaults_extra_file=$topdir/740489.cnf |
1451 | 14 | echo "user=root" >> $defaults_extra_file | 14 | |
1452 | 15 | echo "password=password" >> $defaults_extra_file | 15 | cat > $defaults_extra_file <<EOF |
1453 | 16 | 16 | [mysqld] | |
1454 | 17 | mkdir -p $topdir/backup | 17 | datadir=${MYSQLD_DATADIR} |
1455 | 18 | cat ${MYSQLD_VARDIR}/my.cnf | 18 | |
1456 | 19 | run_cmd $IB_BIN --defaults-extra-file=$defaults_extra_file --socket=${MYSQLD_SOCKET} --ibbackup=$XB_BIN $topdir/backup | 19 | [client] |
1457 | 20 | backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'` | 20 | user=root |
1458 | 21 | password=password | ||
1459 | 22 | EOF | ||
1460 | 23 | |||
1461 | 24 | backup_dir=$topdir/backup | ||
1462 | 25 | run_cmd $IB_BIN \ | ||
1463 | 26 | --defaults-extra-file=$defaults_extra_file --socket=${MYSQLD_SOCKET} \ | ||
1464 | 27 | --ibbackup=$XB_BIN --no-timestamp $backup_dir | ||
1465 | 21 | vlog "Backup created in directory $backup_dir" | 28 | vlog "Backup created in directory $backup_dir" |
1466 | 22 | 29 | ||
1468 | 23 | run_cmd ${MYSQL} ${MYSQL_ARGS} --password=password -e "UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root'; FLUSH PRIVILEGES;" | 30 | run_cmd ${MYSQL} ${MYSQL_ARGS} --password=password <<EOF |
1469 | 31 | SET PASSWORD FOR 'root'@'localhost' = PASSWORD(''); | ||
1470 | 32 | EOF | ||
1471 | 24 | 33 | ||
1472 | 25 | stop_server | 34 | stop_server |
1473 | 26 | # Remove datadir | 35 | # Remove datadir |
1474 | 27 | rm -r $mysql_datadir | 36 | rm -r $mysql_datadir |
1475 | 28 | #init_mysql_dir | ||
1476 | 29 | # Restore sakila | 37 | # Restore sakila |
1477 | 30 | vlog "Applying log" | 38 | vlog "Applying log" |
1478 | 31 | vlog "###########" | 39 | vlog "###########" |
1479 | 32 | 40 | ||
1480 | === modified file 'test/t/bug759225.sh' | |||
1481 | --- test/t/bug759225.sh 2012-06-19 06:00:44 +0000 | |||
1482 | +++ test/t/bug759225.sh 2013-04-23 10:01:01 +0000 | |||
1483 | @@ -16,11 +16,13 @@ | |||
1484 | 16 | exit $SKIPPED_EXIT_CODE | 16 | exit $SKIPPED_EXIT_CODE |
1485 | 17 | fi | 17 | fi |
1486 | 18 | 18 | ||
1487 | 19 | MYSQLD_EXTRA_MY_CNF_OPTS=" | ||
1488 | 20 | innodb_flush_method=ALL_O_DIRECT | ||
1489 | 21 | " | ||
1490 | 19 | start_server | 22 | start_server |
1491 | 20 | load_sakila | 23 | load_sakila |
1492 | 21 | 24 | ||
1493 | 22 | # Take backup | 25 | # Take backup |
1494 | 23 | echo "innodb_flush_method=ALL_O_DIRECT" >> $topdir/my.cnf | ||
1495 | 24 | mkdir -p $topdir/backup | 26 | mkdir -p $topdir/backup |
1496 | 25 | innobackupex --stream=tar $topdir/backup > $topdir/backup/out.tar | 27 | innobackupex --stream=tar $topdir/backup > $topdir/backup/out.tar |
1497 | 26 | stop_server | 28 | stop_server |
1498 | @@ -39,11 +41,11 @@ | |||
1499 | 39 | backup_dir=$topdir/backup | 41 | backup_dir=$topdir/backup |
1500 | 40 | cd $backup_dir | 42 | cd $backup_dir |
1501 | 41 | $TAR -ixvf out.tar | 43 | $TAR -ixvf out.tar |
1504 | 42 | cd - >/dev/null 2>&1 | 44 | cd - >/dev/null 2>&1 |
1505 | 43 | innobackupex --apply-log --defaults-file=$topdir/my.cnf $backup_dir | 45 | innobackupex --apply-log $backup_dir |
1506 | 44 | vlog "Restoring MySQL datadir" | 46 | vlog "Restoring MySQL datadir" |
1507 | 45 | mkdir -p $mysql_datadir | 47 | mkdir -p $mysql_datadir |
1509 | 46 | innobackupex --copy-back --defaults-file=$topdir/my.cnf $backup_dir | 48 | innobackupex --copy-back $backup_dir |
1510 | 47 | 49 | ||
1511 | 48 | start_server | 50 | start_server |
1512 | 49 | # Check sakila | 51 | # Check sakila |
1513 | 50 | 52 | ||
1514 | === modified file 'test/t/bug870119.sh' | |||
1515 | --- test/t/bug870119.sh 2013-03-05 13:07:11 +0000 | |||
1516 | +++ test/t/bug870119.sh 2013-04-23 10:01:01 +0000 | |||
1517 | @@ -4,10 +4,13 @@ | |||
1518 | 4 | 4 | ||
1519 | 5 | . inc/common.sh | 5 | . inc/common.sh |
1520 | 6 | 6 | ||
1521 | 7 | start_server --innodb_file_per_table | ||
1522 | 8 | |||
1523 | 9 | # Set the minimum value for innodb_open_files to be used by xtrabackup | 7 | # Set the minimum value for innodb_open_files to be used by xtrabackup |
1525 | 10 | echo "innodb_open_files=10" >>$topdir/my.cnf | 8 | MYSQLD_EXTRA_MY_CNF_OPTS=" |
1526 | 9 | innodb_file_per_table=1 | ||
1527 | 10 | innodb_open_files=10 | ||
1528 | 11 | " | ||
1529 | 12 | |||
1530 | 13 | start_server | ||
1531 | 11 | 14 | ||
1532 | 12 | load_dbase_schema sakila | 15 | load_dbase_schema sakila |
1533 | 13 | load_dbase_data sakila | 16 | load_dbase_data sakila |
1534 | 14 | 17 | ||
1535 | === modified file 'test/t/bug891496.sh' | |||
1536 | --- test/t/bug891496.sh 2013-03-08 04:37:16 +0000 | |||
1537 | +++ test/t/bug891496.sh 2013-04-23 10:01:01 +0000 | |||
1538 | @@ -5,13 +5,11 @@ | |||
1539 | 5 | 5 | ||
1540 | 6 | . inc/common.sh | 6 | . inc/common.sh |
1541 | 7 | 7 | ||
1549 | 8 | innodb_data_file_path="ibdata1:3M;ibdata2:10M:autoextend" | 8 | MYSQLD_EXTRA_MY_CNF_OPTS=" |
1550 | 9 | 9 | innodb_data_file_path=ibdata1:3M;ibdata2:10M:autoextend | |
1551 | 10 | start_server --innodb_data_file_path=$innodb_data_file_path | 10 | " |
1552 | 11 | 11 | ||
1553 | 12 | cat >> $topdir/my.cnf <<EOF | 12 | start_server |
1547 | 13 | innodb_data_file_path=$innodb_data_file_path | ||
1548 | 14 | EOF | ||
1554 | 15 | 13 | ||
1555 | 16 | load_dbase_schema sakila | 14 | load_dbase_schema sakila |
1556 | 17 | load_dbase_data sakila | 15 | load_dbase_data sakila |
1557 | @@ -40,6 +38,6 @@ | |||
1558 | 40 | vlog "###########" | 38 | vlog "###########" |
1559 | 41 | innobackupex --copy-back $backup_dir | 39 | innobackupex --copy-back $backup_dir |
1560 | 42 | 40 | ||
1562 | 43 | start_server --innodb_data_file_path=$innodb_data_file_path | 41 | start_server |
1563 | 44 | # Check sakila | 42 | # Check sakila |
1564 | 45 | run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila | 43 | run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila |
1565 | 46 | 44 | ||
1566 | === modified file 'test/t/bug976945.sh' | |||
1567 | --- test/t/bug976945.sh 2012-06-18 03:38:41 +0000 | |||
1568 | +++ test/t/bug976945.sh 2013-04-23 10:01:01 +0000 | |||
1569 | @@ -8,8 +8,10 @@ | |||
1570 | 8 | exit $SKIPPED_EXIT_CODE | 8 | exit $SKIPPED_EXIT_CODE |
1571 | 9 | fi | 9 | fi |
1572 | 10 | 10 | ||
1575 | 11 | start_server --innodb_log_block_size=4096 | 11 | MYSQLD_EXTRA_MY_CNF_OPTS=" |
1576 | 12 | echo innodb_log_block_size=4096 >> ${MYSQLD_VARDIR}/my.cnf | 12 | innodb_log_block_size=4096 |
1577 | 13 | " | ||
1578 | 14 | start_server | ||
1579 | 13 | load_sakila | 15 | load_sakila |
1580 | 14 | 16 | ||
1581 | 15 | # Full backup | 17 | # Full backup |
1582 | 16 | 18 | ||
1583 | === modified file 'test/t/bug977101.sh' | |||
1584 | --- test/t/bug977101.sh 2012-06-08 18:46:19 +0000 | |||
1585 | +++ test/t/bug977101.sh 2013-04-23 10:01:01 +0000 | |||
1586 | @@ -17,15 +17,14 @@ | |||
1587 | 17 | 17 | ||
1588 | 18 | # Check that binlog info is correct with --safe-slave-backup | 18 | # Check that binlog info is correct with --safe-slave-backup |
1589 | 19 | innobackupex --no-timestamp --safe-slave-backup $topdir/backup | 19 | innobackupex --no-timestamp --safe-slave-backup $topdir/backup |
1591 | 20 | egrep -q '^mysql-bin.000001[[:space:]]+[0-9]+[[:space:]]+$' \ | 20 | egrep -q '^mysql-bin.[0-9]+[[:space:]]+[0-9]+[[:space:]]+$' \ |
1592 | 21 | $topdir/backup/xtrabackup_binlog_info | 21 | $topdir/backup/xtrabackup_binlog_info |
1593 | 22 | 22 | ||
1594 | 23 | # Check that both binlog info and slave info are correct with | 23 | # Check that both binlog info and slave info are correct with |
1595 | 24 | # --safe-slave-backup | 24 | # --safe-slave-backup |
1596 | 25 | rm -rf $topdir/backup | 25 | rm -rf $topdir/backup |
1597 | 26 | innobackupex --no-timestamp --slave-info --safe-slave-backup $topdir/backup | 26 | innobackupex --no-timestamp --slave-info --safe-slave-backup $topdir/backup |
1599 | 27 | egrep -q '^mysql-bin.000001[[:space:]]+[0-9]+[[:space:]]+$' \ | 27 | egrep -q '^mysql-bin.[0-9]+[[:space:]]+[0-9]+[[:space:]]+$' \ |
1600 | 28 | $topdir/backup/xtrabackup_binlog_info | 28 | $topdir/backup/xtrabackup_binlog_info |
1602 | 29 | egrep -q '^CHANGE MASTER TO MASTER_LOG_FILE='\''mysql-bin.000001'\'', MASTER_LOG_POS=[0-9]+$' \ | 29 | egrep -q '^CHANGE MASTER TO MASTER_LOG_FILE='\''mysql-bin.[0-9]+'\'', MASTER_LOG_POS=[0-9]+$' \ |
1603 | 30 | $topdir/backup/xtrabackup_slave_info | 30 | $topdir/backup/xtrabackup_slave_info |
1604 | 31 | |||
1605 | 32 | 31 | ||
1606 | === modified file 'test/t/ib_doublewrite.sh' | |||
1607 | --- test/t/ib_doublewrite.sh 2012-11-15 15:27:58 +0000 | |||
1608 | +++ test/t/ib_doublewrite.sh 2013-04-23 10:01:01 +0000 | |||
1609 | @@ -15,7 +15,12 @@ | |||
1610 | 15 | fi | 15 | fi |
1611 | 16 | 16 | ||
1612 | 17 | DBLWR=dblwr.ibd | 17 | DBLWR=dblwr.ibd |
1614 | 18 | start_server --innodb_file_per_table --innodb_doublewrite_file=${DBLWR} | 18 | |
1615 | 19 | MYSQLD_EXTRA_MY_CNF_OPTS=" | ||
1616 | 20 | innodb_file_per_table=1 | ||
1617 | 21 | innodb_doublewrite_file=$DBLWR | ||
1618 | 22 | " | ||
1619 | 23 | start_server | ||
1620 | 19 | load_dbase_schema incremental_sample | 24 | load_dbase_schema incremental_sample |
1621 | 20 | 25 | ||
1622 | 21 | # Workaround for bug #1072695 | 26 | # Workaround for bug #1072695 |
1623 | @@ -25,8 +30,6 @@ | |||
1624 | 25 | run_cmd $IB_BIN $IB_ARGS_NO_DEFAULTS_FILE $* | 30 | run_cmd $IB_BIN $IB_ARGS_NO_DEFAULTS_FILE $* |
1625 | 26 | } | 31 | } |
1626 | 27 | 32 | ||
1627 | 28 | echo "innodb_doublewrite_file=${DBLWR}" >>$topdir/my.cnf | ||
1628 | 29 | |||
1629 | 30 | # Adding initial rows | 33 | # Adding initial rows |
1630 | 31 | vlog "Adding initial rows to database..." | 34 | vlog "Adding initial rows to database..." |
1631 | 32 | ${MYSQL} ${MYSQL_ARGS} -e "insert into test values (1, 1);" incremental_sample | 35 | ${MYSQL} ${MYSQL_ARGS} -e "insert into test values (1, 1);" incremental_sample |
1632 | 33 | 36 | ||
1633 | === modified file 'test/t/ib_part_include.sh' | |||
1634 | --- test/t/ib_part_include.sh 2013-03-07 11:38:14 +0000 | |||
1635 | +++ test/t/ib_part_include.sh 2013-04-23 10:01:01 +0000 | |||
1636 | @@ -27,9 +27,9 @@ | |||
1637 | 27 | 27 | ||
1638 | 28 | # also test xtrabackup --stats work with --tables-file | 28 | # also test xtrabackup --stats work with --tables-file |
1639 | 29 | COUNT=`xtrabackup --stats --tables='test.test$' --datadir=$topdir/backup \ | 29 | COUNT=`xtrabackup --stats --tables='test.test$' --datadir=$topdir/backup \ |
1641 | 30 | | grep table: | awk '{print $2}' | sort -u | wc -l` | 30 | | grep table: | grep -v SYS_ | awk '{print $2}' | sort -u | wc -l` |
1642 | 31 | 31 | ||
1644 | 32 | if [ $COUNT != 7 ] ; then | 32 | if [ $COUNT != 5 ] ; then |
1645 | 33 | vlog "xtrabackup --stats does not work" | 33 | vlog "xtrabackup --stats does not work" |
1646 | 34 | exit -1 | 34 | exit -1 |
1647 | 35 | fi | 35 | fi |
1648 | 36 | 36 | ||
1649 | === modified file 'test/t/ib_part_tf_innodb.sh' | |||
1650 | --- test/t/ib_part_tf_innodb.sh 2013-03-07 11:38:14 +0000 | |||
1651 | +++ test/t/ib_part_tf_innodb.sh 2013-04-23 10:01:01 +0000 | |||
1652 | @@ -30,9 +30,9 @@ | |||
1653 | 30 | vlog "Backup taken" | 30 | vlog "Backup taken" |
1654 | 31 | 31 | ||
1655 | 32 | COUNT=`xtrabackup --stats --tables-file=$topdir/tables --datadir=$topdir/backup \ | 32 | COUNT=`xtrabackup --stats --tables-file=$topdir/tables --datadir=$topdir/backup \ |
1657 | 33 | | grep table: | awk '{print $2}' | sort -u | wc -l` | 33 | | grep table: | grep -v SYS_ | awk '{print $2}' | sort -u | wc -l` |
1658 | 34 | echo "COUNT = $COUNT" | 34 | echo "COUNT = $COUNT" |
1660 | 35 | if [ $COUNT != 7 ] ; then | 35 | if [ $COUNT != 5 ] ; then |
1661 | 36 | vlog "xtrabackup --stats does not work" | 36 | vlog "xtrabackup --stats does not work" |
1662 | 37 | exit -1 | 37 | exit -1 |
1663 | 38 | fi | 38 | fi |
1664 | 39 | 39 | ||
1665 | === modified file 'test/t/ib_slave_info.sh' | |||
1666 | --- test/t/ib_slave_info.sh 2012-06-05 12:35:33 +0000 | |||
1667 | +++ test/t/ib_slave_info.sh 2013-04-23 10:01:01 +0000 | |||
1668 | @@ -30,7 +30,7 @@ | |||
1669 | 30 | $topdir/backup | 30 | $topdir/backup |
1670 | 31 | 31 | ||
1671 | 32 | innobackupex --no-timestamp --slave-info $topdir/backup | 32 | innobackupex --no-timestamp --slave-info $topdir/backup |
1673 | 33 | egrep -q '^mysql-bin.000001[[:space:]]+[0-9]+[[:space:]]+$' \ | 33 | egrep -q '^mysql-bin.[0-9]+[[:space:]]+[0-9]+[[:space:]]+$' \ |
1674 | 34 | $topdir/backup/xtrabackup_binlog_info | 34 | $topdir/backup/xtrabackup_binlog_info |
1676 | 35 | egrep -q '^CHANGE MASTER TO MASTER_LOG_FILE='\''mysql-bin.000001'\'', MASTER_LOG_POS=[0-9]+$' \ | 35 | egrep -q '^CHANGE MASTER TO MASTER_LOG_FILE='\''mysql-bin.[0-9]+'\'', MASTER_LOG_POS=[0-9]+$' \ |
1677 | 36 | $topdir/backup/xtrabackup_slave_info | 36 | $topdir/backup/xtrabackup_slave_info |
1678 | 37 | 37 | ||
1679 | === added file 'test/t/remote_tablespaces.sh' | |||
1680 | --- test/t/remote_tablespaces.sh 1970-01-01 00:00:00 +0000 | |||
1681 | +++ test/t/remote_tablespaces.sh 2013-04-23 10:01:01 +0000 | |||
1682 | @@ -0,0 +1,53 @@ | |||
1683 | 1 | ######################################################################## | ||
1684 | 2 | # Test remote tablespaces in InnoDB 5.6 | ||
1685 | 3 | ######################################################################## | ||
1686 | 4 | |||
1687 | 5 | . inc/common.sh | ||
1688 | 6 | |||
1689 | 7 | if [ ${MYSQL_VERSION:0:3} != "5.6" ] | ||
1690 | 8 | then | ||
1691 | 9 | echo "Requires a 5.6 server" > $SKIPPED_REASON | ||
1692 | 10 | exit $SKIPPED_EXIT_CODE | ||
1693 | 11 | fi | ||
1694 | 12 | |||
1695 | 13 | start_server --innodb_file_per_table | ||
1696 | 14 | |||
1697 | 15 | remote_dir=$TEST_BASEDIR/var1/remote_dir | ||
1698 | 16 | |||
1699 | 17 | $MYSQL $MYSQL_ARGS test <<EOF | ||
1700 | 18 | CREATE TABLE t(id INT AUTO_INCREMENT PRIMARY KEY, c INT) | ||
1701 | 19 | DATA DIRECTORY = '$remote_dir' ENGINE=InnoDB; | ||
1702 | 20 | INSERT INTO t(c) VALUES (1), (2), (3), (4), (5), (6), (7), (8); | ||
1703 | 21 | EOF | ||
1704 | 22 | |||
1705 | 23 | # Generate some log data, as we also want to test recovery of remote tablespaces | ||
1706 | 24 | for ((i=0; i<12; i++)) | ||
1707 | 25 | do | ||
1708 | 26 | $MYSQL $MYSQL_ARGS test <<EOF | ||
1709 | 27 | INSERT INTO t(c) SELECT c FROM t; | ||
1710 | 28 | EOF | ||
1711 | 29 | done | ||
1712 | 30 | |||
1713 | 31 | checksum_a=`checksum_table test t` | ||
1714 | 32 | |||
1715 | 33 | innobackupex --no-timestamp $topdir/backup | ||
1716 | 34 | |||
1717 | 35 | stop_server | ||
1718 | 36 | |||
1719 | 37 | rm -rf $mysql_datadir/* | ||
1720 | 38 | |||
1721 | 39 | innobackupex --apply-log $topdir/backup | ||
1722 | 40 | innobackupex --copy-back $topdir/backup | ||
1723 | 41 | |||
1724 | 42 | start_server | ||
1725 | 43 | |||
1726 | 44 | checksum_b=`checksum_table test t` | ||
1727 | 45 | |||
1728 | 46 | vlog "Old checksum: $checksum_a" | ||
1729 | 47 | vlog "New checksum: $checksum_b" | ||
1730 | 48 | |||
1731 | 49 | if [ "$checksum_a" != "$checksum_b" ] | ||
1732 | 50 | then | ||
1733 | 51 | vlog "Checksums do not match" | ||
1734 | 52 | exit -1 | ||
1735 | 53 | fi | ||
1736 | 0 | 54 | ||
1737 | === added file 'test/t/undo_tablespaces.sh' | |||
1738 | --- test/t/undo_tablespaces.sh 1970-01-01 00:00:00 +0000 | |||
1739 | +++ test/t/undo_tablespaces.sh 2013-04-23 10:01:01 +0000 | |||
1740 | @@ -0,0 +1,75 @@ | |||
1741 | 1 | ######################################################################## | ||
1742 | 2 | # Test support for separate UNDO tablespace | ||
1743 | 3 | ######################################################################## | ||
1744 | 4 | |||
1745 | 5 | . inc/common.sh | ||
1746 | 6 | |||
1747 | 7 | if [ ${MYSQL_VERSION:0:3} != "5.6" ] | ||
1748 | 8 | then | ||
1749 | 9 | echo "Requires a 5.6 server" > $SKIPPED_REASON | ||
1750 | 10 | exit $SKIPPED_EXIT_CODE | ||
1751 | 11 | fi | ||
1752 | 12 | |||
1753 | 13 | ################################################################################ | ||
1754 | 14 | # Start an uncommitted transaction pause "indefinitely" to keep the connection | ||
1755 | 15 | # open | ||
1756 | 16 | ################################################################################ | ||
1757 | 17 | function start_uncomitted_transaction() | ||
1758 | 18 | { | ||
1759 | 19 | run_cmd $MYSQL $MYSQL_ARGS sakila <<EOF | ||
1760 | 20 | START TRANSACTION; | ||
1761 | 21 | DELETE FROM payment; | ||
1762 | 22 | SELECT SLEEP(10000); | ||
1763 | 23 | EOF | ||
1764 | 24 | } | ||
1765 | 25 | |||
1766 | 26 | undo_directory=$TEST_BASEDIR/var1/undo_dir | ||
1767 | 27 | |||
1768 | 28 | MYSQLD_EXTRA_MY_CNF_OPTS=" | ||
1769 | 29 | innodb_file_per_table=1 | ||
1770 | 30 | innodb_undo_directory=$undo_directory | ||
1771 | 31 | innodb_undo_tablespaces=4 | ||
1772 | 32 | " | ||
1773 | 33 | |||
1774 | 34 | start_server | ||
1775 | 35 | load_sakila | ||
1776 | 36 | |||
1777 | 37 | checksum1=`checksum_table sakila payment` | ||
1778 | 38 | test -n "$checksum1" || die "Failed to checksum table sakila.payment" | ||
1779 | 39 | |||
1780 | 40 | # Start a transaction, modify some data and keep it uncommitted for the backup | ||
1781 | 41 | # stage. InnoDB avoids using the rollback segment in the system tablespace, if | ||
1782 | 42 | # separate undo tablespaces are used, so the test would fail if we did not | ||
1783 | 43 | # handle separate undo tablespaces correctly. | ||
1784 | 44 | start_uncomitted_transaction & | ||
1785 | 45 | job_master=$! | ||
1786 | 46 | |||
1787 | 47 | innobackupex --no-timestamp $topdir/backup | ||
1788 | 48 | |||
1789 | 49 | kill -SIGKILL $job_master | ||
1790 | 50 | stop_server | ||
1791 | 51 | |||
1792 | 52 | rm -rf $MYSQLD_DATADIR/* | ||
1793 | 53 | rm -rf $undo_directory/* | ||
1794 | 54 | |||
1795 | 55 | innobackupex --apply-log $topdir/backup | ||
1796 | 56 | |||
1797 | 57 | innobackupex --copy-back $topdir/backup | ||
1798 | 58 | |||
1799 | 59 | |||
1800 | 60 | |||
1801 | 61 | start_server | ||
1802 | 62 | |||
1803 | 63 | # Check that the uncommitted transaction has been rolled back | ||
1804 | 64 | |||
1805 | 65 | checksum2=`checksum_table sakila payment` | ||
1806 | 66 | test -n "$checksum2" || die "Failed to checksum table sakila.payment" | ||
1807 | 67 | |||
1808 | 68 | vlog "Old checksum: $checksum1" | ||
1809 | 69 | vlog "New checksum: $checksum2" | ||
1810 | 70 | |||
1811 | 71 | if [ "$checksum1" != "$checksum2" ] | ||
1812 | 72 | then | ||
1813 | 73 | vlog "Checksums do not match" | ||
1814 | 74 | exit -1 | ||
1815 | 75 | fi | ||
1816 | 0 | 76 | ||
1817 | === modified file 'test/t/xb_basic.sh' | |||
1818 | --- test/t/xb_basic.sh 2012-10-15 16:14:59 +0000 | |||
1819 | +++ test/t/xb_basic.sh 2013-04-23 10:01:01 +0000 | |||
1820 | @@ -13,7 +13,6 @@ | |||
1821 | 13 | stop_server | 13 | stop_server |
1822 | 14 | # Remove datadir | 14 | # Remove datadir |
1823 | 15 | rm -r $mysql_datadir | 15 | rm -r $mysql_datadir |
1824 | 16 | #init_mysql_dir | ||
1825 | 17 | # Restore sakila | 16 | # Restore sakila |
1826 | 18 | vlog "Applying log" | 17 | vlog "Applying log" |
1827 | 19 | vlog "###########" | 18 | vlog "###########" |
1828 | 20 | 19 | ||
1829 | === modified file 'test/t/xb_version.sh' | |||
1830 | --- test/t/xb_version.sh 2011-06-14 14:34:23 +0000 | |||
1831 | +++ test/t/xb_version.sh 2013-04-23 10:01:01 +0000 | |||
1832 | @@ -1,4 +1,3 @@ | |||
1833 | 1 | . inc/common.sh | 1 | . inc/common.sh |
1834 | 2 | 2 | ||
1835 | 3 | xtrabackup --version | 3 | xtrabackup --version |
1836 | 4 | |||
1837 | 5 | 4 | ||
1838 | === modified file 'test/testrun.sh' | |||
1839 | --- test/testrun.sh 2013-03-13 05:05:16 +0000 | |||
1840 | +++ test/testrun.sh 2013-04-23 10:01:01 +0000 | |||
1841 | @@ -176,7 +176,7 @@ | |||
1842 | 176 | then | 176 | then |
1843 | 177 | INNODB_FLAVOR="XtraDB" | 177 | INNODB_FLAVOR="XtraDB" |
1844 | 178 | else | 178 | else |
1846 | 179 | INNODB_FLAVOR="innoDB" | 179 | INNODB_FLAVOR="InnoDB" |
1847 | 180 | fi | 180 | fi |
1848 | 181 | 181 | ||
1849 | 182 | if [ "$XB_BUILD" = "autodetect" ] | 182 | if [ "$XB_BUILD" = "autodetect" ] |
Same spurious issues as in https:/ /code.launchpad .net/~akopytov/ percona- xtrabackup/ bug1169169- 2.0/+merge/ 160272