Results 1 to 2 of 2

Thread: Mysql-zrm 2 & 3 bug that ignores the mysqldump exitcodes. Backup integrity?

  1. #1

    Default Mysql-zrm 2 & 3 bug that ignores the mysqldump exitcodes. Backup integrity?

    Hey guys,

    I believe I stumbled upon a fairly major bug when using mysql-zrm 2 and 3 (EPEL version) where the exitcodes of the command pipeline when using logical backups are ignored. It seems like the logic for it is half implemented or I'm missing something obvious. I stumbled upon this issue when noticing that one database installation wasn't actually backing up all the data, but mysql-zrm was reporting it as a success. When debugging I found that the mysqldump was failing with an exitcode of 2 and this message:

    "VIEW references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them (1356)"

    The temporary file that records the $PIPESTATUS[@] of the run shows 2 as well, but the $rt that's tested is 0. Here is the patch I created that resolves the issue.

    --- /usr/bin/mysql-zrm-backup 2014-07-25 13:16:37.000000000 -0400
    +++ mysql-zrm-backup 2014-10-10 15:32:05.558346707 -0400
    @@ -1833,7 +1833,29 @@
    if( $abort_flag ){
    &abortAndDie( );
    }
    - if( $r > 0 ) {
    +
    + # Check the pipestatus as it will indicate if something horrendously wrong
    + # occurred with mysqldump
    + unless (open(PIPESTATUS, $pipestatus)) {
    + &printAndDie( "Could not read pipestatus file for pipe exitcode ".$pipestatus."\n" );
    + }
    + my @pipe_exitcodes = <PIPESTATUS>;
    + close(PIPESTATUS);
    + if( ! @pipe_exitcodes ) {
    + &printAndDie( "Could not get pipe exitcodes!" );
    + }
    +
    + # Check exitcode of every command in pipeline
    + my $pipe_exit = 0;
    + my @s_exitcodes = split(/\s+/, $pipe_exitcodes[0]);
    + foreach (@s_exitcodes) {
    + if ($_ > 0) {
    + $pipe_exit = $_;
    + last;
    + }
    + }
    +
    + if( $r > 0 or $pipe_exit > 0) {
    &printLog("Command exit status is : $r \n" );
    &printCommandOutputToLog( "ERROR", "command is : $command", $CMDERR );
    &printCommandOutputToLog( "ERROR", "pipe exit status", $pipestatus );
    @@ -1841,8 +1863,8 @@
    }elsif ( -s $CMDERR ) {
    &printCommandOutputToLog( ($CMDERR =~ /warning/i) ? "INFO" : "WARNING", "mysqldump output for command : $command", $CMDERR );
    }
    unlink($CMDERR);
    unlink($pipestatus);
    }

    sub checkAndBackupReplicationData()




    Can anyone comment on this?

  2. #2
    Join Date
    Apr 2015
    Posts
    1

    Default

    I'm missing something obvious. I stumbled upon this issue when noticing that one database installation wasn't actually backing up all the data, but mysql-zrm was reporting it as a success. When debugging I found that the mysqldump was failing with an exitcode





    Cut down your exam stress by using our latest [url=http://www.e-six-sigma.com]http://www.e-six-sigma.com/[/url] and high quality gmat and We provide updated [url=http://www.hodges.edu/]hodges.edu[/url] with 100% pass guarantee along with [url=http://en.wikipedia.org/wiki/Caldwell_University]Caldwell College[/url]
    Last edited by ajoyna1; April 20th, 2015 at 10:01 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •