hugowan / maatkit

Automatically exported from code.google.com/p/maatkit
0 stars 0 forks source link

mk-parallel-dump sends --skip-lock-tables to mysqldump that doesn't accept it #128

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If this is a problem report, what steps will reproduce the problem?

After an upgrade I have some troubles.

I used to bakup my databases using maatkit 1877-1 with the following:

mk-parallel-dump \
  --setperdb \
   --basedir /var/lib/backup-mysql/%D/$MY_DATE \
   -- mkdir -p "/var/lib/backup-mysql/%D/$MY_DATE" \; \
   mysqldump --skip-lock-tables '%D' '%N' \| \
     filter_dump \| \
       bzip2 \> "/var/lib/backup-mysql/%D/$MY_DATE/%N.bz2"

It worked well except for the master data that was incorrectly placed in
/var/lib/backup-mysql/%D/$MY_DATE/<DATABASENAME>/00_master_data.sql
where %D is really %D, not a placeholder.
instead of
/var/lib/backup-mysql/<DATABASENAME>/$MY_DATE/00_master_data.sql

Now using maatkit 2442-1 the I see a lot of errors like:

mkdir: unrecognized option `--skip-lock-tables'
Try `mkdir --help' for more information.

It seem that the command line parser now works differently.

Thanks in advance.

What is the expected output? What do you see instead?

The backup as the old version does.
A lot of errors.

What information do you get from mk-<toolname>--version?

Old:
mk-parallel-dump  Ver 1.0.7 Distrib 1877 Changeset 1871
New:
mk-parallel-dump  Ver 1.0.10 Distrib 2442 Changeset 2434

What is your MySQL, Perl, DBI, and DBD::mysql version?

The same, so the problem it's not here.

What is your operating system/distribution?

Debian lenny.

If you think it'll be useful, please run the tool with MKDEBUG=1 and
capture the full output in a file, then attach the file.  For example,
MKDEBUG=1 mk-<toolname> [options] > debug.txt.  Is there anything in this
file that you think we should pay special attention to?  Please gzip the
file if it's large.

No, it will not be usefull.

Please provide any additional information below.

Thanks in advance.

Original issue reported on code.google.com by i...@matrixcom.it on 14 Nov 2008 at 10:14

GoogleCodeExporter commented 9 years ago
Actually, I think this is not Maatkit.  It's mysqldump, which you would 
probably see
if you examine the MKDEBUG output.  Please confirm.

Summary "option parser behaves differently 1877 vs 2442" changed.

Original comment by baron.schwartz on 18 Nov 2008 at 1:50

GoogleCodeExporter commented 9 years ago
Sorry for not being clear.

Ok, options are parsed in the same way:

Old:
# main:2089 Args for mysqldump: mkdir, -p, /tmp/abc/%D/20081118-161530, ;, 
mysqldump,
--skip-lock-tables, %D, %N, |, filter_dump, |, bzip2, >,
/tmp/abc/%D/20081118-161530/%N.bz2

New:
# main:2165 Args for mysqldump: mkdir, -p, /tmp/abc/%D/20081118-161530, ;, 
mysqldump,
--skip-lock-tables, %D, %N, |, filter_dump, |, bzip2, >,
/tmp/abc/%D/20081118-161530/%N.bz2

But the command is executed differently.
Sorry but I can't find anything usefu with
MKDEBUG=1 so I used strace -fF -e trace=process

Old version:

[pid 18143] execve("/bin/sh", ["sh", "-c", "mkdir -p 
/tmp/abc/DBNAME/20081118-161530
; mysqldump --skip-lock-tables DBNAME DBTABLE | filter
_dump | bzip2 > /tmp/abc/DBNAME/20081118-161530/DBTABLE.bz2"], [...]

New version:

[pid 27618] execve("/bin/sh", ["sh", "-c", "mkdir -p
\'/tmp/abc/DBNAME/20081118-161530\' \';\' mysqldump --skip-lock-tables 
\'DBNAME\'
DBTABLE | filter_dump | bzip2 > 
\'/tmp/abc/DBNAME/20081118-161530/DBTABLE.bz2\'"] [...]

So basically in the first version sh use ; as command separator and
in the last as paramenter.

The first version allow more than one command, the last not.

No solution is right by /default/.
The first is more flexible.
But I could try to wrap my commands in my own script to accomodate the
change.

Thanks again.

Original comment by i...@matrixcom.it on 18 Nov 2008 at 4:11

GoogleCodeExporter commented 9 years ago
I think the way system() is called was changed, though I have not investigated 
yet. 
Before I do, I'd like to know whether you'd like to just a) put your commands 
in your
own script or b) add some options so the dump program moves things to the
current-date directory and uses bzip2 instead of gzip?

Original comment by baron.schwartz on 24 Nov 2008 at 12:02

GoogleCodeExporter commented 9 years ago
Sorry for the delay.
I finally put my commands in my own script.
Thanks

Original comment by i...@matrixcom.it on 29 Dec 2008 at 1:53

GoogleCodeExporter commented 9 years ago
Looks like there is no need for this one.  If this becomes an issue in the 
future, we
can modify the tool to prefix all options with "--loose-".

Original comment by baron.schwartz on 3 May 2009 at 3:02