pgbackrest.git / summary / log / commit / refs

commit    ae3dcc57f01983e4eac6ca72bb482b9fa2e6e4d3
Author:   David Steele <github@thelabyrinth.net>
Date:     Fri Feb 14 02:31:57 2014 +0000

    Thread errors now exit


pg_backrest_backup.pm | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pg_backrest_backup.pm b/pg_backrest_backup.pm index e2ca8db23..cec9885da 100644 --- a/pg_backrest_backup.pm +++ b/pg_backrest_backup.pm @@ -721,6 +721,15 @@ sub backup_file { $oThread[$iThreadIdx]->join(); } + + # Look for errors + for (my $iThreadIdx = 0; $iThreadIdx < $iThreadMax; $iThreadIdx++) + { + if (defined($oThread[$iThreadIdx]->error())) + { + confess &log(ERROR, "error in thread ${iThreadIdx}: check log for details"); + } + } } sub backup_file_thread @@ -782,6 +791,12 @@ sub backup if (defined($strBackupLastPath)) { %oLastManifest = backup_manifest_load($oFile->path_get(PATH_BACKUP_CLUSTER) . "/$strBackupLastPath/backup.manifest"); + + if (!defined($oLastManifest{common}{backup}{label})) + { + confess &log(ERROR, "unable to find label in backup $strBackupLastPath"); + } + &log(INFO, "last backup label: $oLastManifest{common}{backup}{label}"); } @@ -840,8 +855,6 @@ sub backup my %oBackupManifest; # Start backup - ${oBackupManifest}{common}{backup}{label} = $strBackupPath; - my $strArchiveStart = $oDb->backup_start($strBackupPath); ${oBackupManifest}{archive}{archive_location}{start} = $strArchiveStart; @@ -898,7 +911,10 @@ sub backup $oFile->file_copy(PATH_BACKUP_ARCHIVE, $stryArchiveFile[0], PATH_BACKUP_TMP, "base/pg_xlog/${strArchive}"); } } - + + # Store the label in the manifest + ${oBackupManifest}{common}{backup}{label} = $strBackupPath; + # Need some sort of backup validate - create a manifest and compare the backup manifest # !!! DO IT [parent: 6d9e7db1c69e]