Merge lp:~sergei.glushchenko/percona-xtrabackup/bug489290_targetdir_rel_pwd into lp:percona-xtrabackup/2.0
Status: | Rejected |
---|---|
Rejected by: | Alexey Kopytov |
Proposed branch: | lp:~sergei.glushchenko/percona-xtrabackup/bug489290_targetdir_rel_pwd |
Merge into: | lp:percona-xtrabackup/2.0 |
Diff against target: |
235 lines (+153/-7) 6 files modified
doc/source/xtrabackup_bin/creating_a_backup.rst (+1/-1) doc/source/xtrabackup_bin/xbk_option_reference.rst (+1/-1) innobackupex (+5/-5) kewpie/percona_tests/xtrabackup_main/bug489290_test.py (+90/-0) test/t/bug489290.sh (+42/-0) xtrabackup.c (+14/-0) |
To merge this branch: | bzr merge lp:~sergei.glushchenko/percona-xtrabackup/bug489290_targetdir_rel_pwd |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Needs Information | ||
Review via email: mp+88694@code.launchpad.net |
Description of the change
Behaviour of '--target-dir' option changed. If relative path specified, it considered to be relative to the directory where xtrabackup executed.
Jenkins: http://
(it may be a bit hard to see if it breaks anything as everything isn't passing everywhere yet)
Unmerged revisions
- 390. By Sergei Glushchenko
-
Bug 489290:
./xtrabackup --backup
creates database "xtrabackup_backupfiles" .
The reasons are following:
1. Default value for target-dir option is "./xtrabackup_backupfiles/ "
2. xtrabackup changes current working directory to datadir when backup option is specified
Solution is to use my_load_path to expand target-dir value before changing working directory. - 389. By Stewart Smith
-
merge other patches from 1.6: bug711207
- 388. By Stewart Smith
-
merge fix for placement of xtrabackup_
suspended and xtrabackup_ checkpoint - 387. By Stewart Smith
-
merge innodb version detection failure fix
- 386. By Stewart Smith
-
merge 1.9.0 release notes
- 385. By Stewart Smith
-
merge fix for bug 733658: pass options to both ssh and scp
- 384. By Stewart Smith
-
merge trademark policy in docs
- 383. By Stewart Smith
-
merge fix of broken links in docs
- 382. By Hrvoje Matijakovic
-
Merge from lp:~hrvojem/percona-xtrabackup/bug919203
- 381. By Hrvoje Matijakovic
-
Merge from lp:~hrvojem/percona-xtrabackup/mngtools.
Sergei,
On 16.01.12 17:55, Sergei Glushchenko wrote:
> Jenkins: http:// jenkins. percona. com/view/ Percona% 20Xtrabackup/ job/percona- xtrabackup- trunk-kewpie/ 21/
> (it may be a bit hard to see if it breaks anything as everything isn't passing everywhere yet)
>
Um, it's insanity. I suggest we don't use kewpie until we have a clean
baseline. Can you please rewrite that test case to the old testing
framework?
> +/***** ******* ******* ******* ******* ******* ******* ******* ******* ******* ****** target_ dir_name( ) dir[FN_ REFLEN] ; target_ dir should be relative to pwd, not to datadir. target_ dir && (xtrabackup_ target_ dir[0] != FN_LIBCHAR)) current_ dir, sizeof( current_ dir), MYF(MY_WME)))
> +Expands target dir name to full path name if it is relative.*/
> +static void
> +expand_
> +{
> + char current_
> + size_t current_dir_len;
> +
> + /* xtrabackup_
> + convert it to absolute path if it's relative */
> + if (xtrabackup_
> + {
> + if (my_getwd(
> + {
> + fprintf(stderr, "xtrabackup: cannot my_getwd\n");
You don't have to do that. With the MY_WME flag my_getwd() will print
the following message on error:
Can't get working directory (Errcode: %d)
So there's no need for an explicit error message. I know it's a
copy-paste from elsewhere, but that code does not have to do that either.
> + exit(EXIT_FAILURE); current_ dir); target_ dir, dirname( xtrabackup_ real_target_ dir, current_dir); target_ dir = xtrabackup_ real_target_ dir;
> + }
> + current_dir_len = strlen(
> + strnmov(current_dir + current_dir_len, xtrabackup_
> + sizeof(current_dir) - current_dir_len - 1);
> + cleanup_
> + xtrabackup_
Wouldn't cleanup_ dirname( xtrabackup_ target_ dir, xtrabackup_ target_ dir)
be sufficient? It just looks like you're duplicating a part of
cleanup_dirname().
Or, even better, why not use unpack_dirname() to allow "~" in
--target-dir argument?
> + } backup_ func(void) ).\n"); target_ dir_name( ); mysql_real_ data_home, MYF(MY_ WME))) target_ dir_name( );
> +
> +}
> +
> static void
> xtrabackup_
> {
> @@ -3706,6 +3732,9 @@
> fprintf(stderr, "xtrabackup: uses posix_fadvise(
> #endif
>
> + /* ensure target dir will not be relative to datadir */
> + expand_
> +
> /* cd to datadir */
>
> if (my_setwd(
> @@ -4622,6 +4651,9 @@
> {
> ulint n;
>
> + /* ensure target dir will not be relative to datadir */
> + expand_
> +
Would calling expand_ target_ dir_name( ) or cleanup_dirname() or
unpack_dirname() from get_one_option() be a better place to do the
conversion to avoid code duplication?
> /* cd to datadir */ mysql_real_ data_home, MYF(MY_ WME)))
>
> if (my_setwd(
>
needsfixing