1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-27 00:21:08 +02:00

Ensure latest db-id is selected on when matching archive.info to backup.info.

This provides correct matching in the event there are system-id and db-version duplicates (e.g. after reverting a pg_upgrade).

Fixed by Cynthia Shang.
Reported by Adam K. Sumner.
This commit is contained in:
Cynthia Shang
2018-01-30 16:49:47 -05:00
committed by David Steele
parent 00f58ec8c0
commit bacc08792d
3 changed files with 28 additions and 1 deletions

View File

@ -186,6 +186,18 @@ sub run
$strArchiveId = &PG_VERSION_93 . "-" . $iHistoryId;
$self->testResult(sub {$oBackupInfo->backupArchiveDbHistoryId($strArchiveId,
storageRepo()->pathGet(STORAGE_REPO_ARCHIVE))}, "[undef]", 'same db system-id but different version');
# First and last version and ullsystemid same in backup.info but only 1st in archive info - return last
#---------------------------------------------------------------------------------------------------------------------------
$iHistoryId = $oBackupInfo->dbHistoryIdGet(true)+1;
$oBackupInfo->dbSectionSet(
PG_VERSION_93, $i93ControlVersion, $i93CatalogVersion, $self->dbSysId(PG_VERSION_93), $iHistoryId);
$oBackupInfo->save();
$strArchiveId = &PG_VERSION_93 . "-1";
$self->testResult(sub {$oBackupInfo->backupArchiveDbHistoryId($strArchiveId,
storageRepo()->pathGet(STORAGE_REPO_ARCHIVE))}, $iHistoryId, 'duplicate 1st and last version/sysid - last chosen');
}
################################################################################################################################