Changeset 237

Show
Ignore:
Timestamp:
05/07/11 13:59:18 (3 years ago)
Author:
depesz
Message:

Hopefully, it should solve the problem reported by Robert

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/omnipitr-with-slave-backups-calling-master/lib/OmniPITR/Program/Backup/Slave.pm

    r236 r237  
    4848    $self->log->log( q{pg_stop_backup() returned %s.}, $stop_backup_output ); 
    4949    $self->log->fatal( 'Output from pg_stop_backup is not parseable?!' ) unless $stop_backup_output =~ m{\A([0-9A-F]+)/([0-9A-F]{1,8})\z}; 
    50  
    51     my ( $part_1, $part_2 ) = ( $1, $2 ); 
    52     $part_2 =~ s/(.{1,6})\z//; 
    53     my $part_3 = $1; 
    54  
    55     my $expected_filename_suffix = sprintf '%08s%08s.%08s.backup', $part_1, $part_2, $part_3; 
    56  
    57     if ( 'none' ne $self->{ 'source' }->{ 'compression' } ) { 
    58         my $extension = ext_for_compression( $self->{ 'source' }->{ 'compression' } ); 
    59         $expected_filename_suffix .= $extension; 
    60     } 
    61  
    62     my $backup_filename_re = qr{\A[0-9A-F]{8}\Q$expected_filename_suffix\E\z}; 
    63  
    64     $self->{ 'stop_backup_filename_re' } = $backup_filename_re; 
    6550 
    6651    return; 
     
    316301    $self->log->log( q{pg_start_backup('omnipitr') returned %s.}, $start_backup_output ); 
    317302    $self->log->fatal( 'Output from pg_start_backup is not parseable?!' ) unless $start_backup_output =~ m{\A([0-9A-F]+)/([0-9A-F]{1,8})\z}; 
     303 
     304    my ( $part_1, $part_2 ) = ( $1, $2 ); 
     305    $part_2 =~ s/(.{1,6})\z//; 
     306    my $part_3 = $1; 
     307 
     308    my $expected_filename_suffix = sprintf '%08s%08s.%08s.backup', $part_1, $part_2, $part_3; 
     309 
     310    if ( 'none' ne $self->{ 'source' }->{ 'compression' } ) { 
     311        my $extension = ext_for_compression( $self->{ 'source' }->{ 'compression' } ); 
     312        $expected_filename_suffix .= $extension; 
     313    } 
     314 
     315    my $backup_filename_re = qr{\A[0-9A-F]{8}\Q$expected_filename_suffix\E\z}; 
     316 
     317    $self->{ 'stop_backup_filename_re' } = $backup_filename_re; 
    318318 
    319319    my $backup_label_content = $self->psql(