Use raw compression/encryption to bundling and block incremental backup.

Raw encryption was already being used for block incremental. This commit adds raw compression to block incremental where possible (see da918587).

Raw compression/encryption is also added to bundling for a backup set when block incremental is enabled on the full backup. This prevents a break in backward compatibility since block incremental is not backward compatible.
This commit is contained in:
David Steele
2023-03-07 18:46:24 +07:00
parent da91858702
commit 7e5adc0359
15 changed files with 91 additions and 34 deletions
+1
View File
@@ -26,6 +26,7 @@
<commit subject="Add repo-block-age-map and repo-block-size-map options."/>
<commit subject="Rename block incremental manifest keys."/>
<commit subject="Add optional raw format for compression types."/>
<commit subject="Use raw compression/encryption to bundling and block incremental backup."/>
<release-item-contributor-list>
<release-item-contributor id="david.steele"/>
+1
View File
@@ -1871,6 +1871,7 @@ backupJobCallback(void *data, unsigned int clientIdx)
{
pckWriteStrP(param, backupFileRepoPathP(jobData->backupLabel, .bundleId = jobData->bundleId));
pckWriteU64P(param, jobData->bundleId);
pckWriteBoolP(param, manifestData(jobData->manifest)->bundleRaw);
}
else
{
+7 -3
View File
@@ -39,13 +39,14 @@ segmentNumber(const String *pgFile)
/**********************************************************************************************************************************/
FN_EXTERN List *
backupFile(
const String *const repoFile, const uint64_t bundleId, const unsigned int blockIncrReference,
const String *const repoFile, const uint64_t bundleId, const bool bundleRaw, const unsigned int blockIncrReference,
const CompressType repoFileCompressType, const int repoFileCompressLevel, const CipherType cipherType,
const String *const cipherPass, const List *const fileList)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
FUNCTION_LOG_PARAM(STRING, repoFile); // Repo file
FUNCTION_LOG_PARAM(UINT64, bundleId); // Bundle id (0 if none)
FUNCTION_LOG_PARAM(BOOL, bundleRaw); // Raw compress/encrypt format in bundles?
FUNCTION_LOG_PARAM(UINT, blockIncrReference); // Block incremental reference to use in map
FUNCTION_LOG_PARAM(ENUM, repoFileCompressType); // Compress type for repo file
FUNCTION_LOG_PARAM(INT, repoFileCompressLevel); // Compression level for repo file
@@ -215,12 +216,15 @@ backupFile(
// Compress filter
IoFilter *const compress =
repoFileCompressType != compressTypeNone ?
compressFilterP(repoFileCompressType, repoFileCompressLevel) : NULL;
compressFilterP(
repoFileCompressType, repoFileCompressLevel, .raw = bundleRaw || file->blockIncrSize != 0) :
NULL;
// Encrypt filter
IoFilter *const encrypt =
cipherType != cipherTypeNone ?
cipherBlockNewP(cipherModeEncrypt, cipherType, BUFSTR(cipherPass), .raw = file->blockIncrSize != 0) :
cipherBlockNewP(
cipherModeEncrypt, cipherType, BUFSTR(cipherPass), .raw = bundleRaw || file->blockIncrSize != 0) :
NULL;
// If block incremental then add the filter and pass compress/encrypt filters to it since each block is
+1 -1
View File
@@ -58,7 +58,7 @@ typedef struct BackupFileResult
} BackupFileResult;
FN_EXTERN List *backupFile(
const String *repoFile, uint64_t bundleId, unsigned int blockIncrReference, CompressType repoFileCompressType,
const String *repoFile, uint64_t bundleId, bool bundleRaw, unsigned int blockIncrReference, CompressType repoFileCompressType,
int repoFileCompressLevel, CipherType cipherType, const String *cipherPass, const List *fileList);
#endif
+3 -1
View File
@@ -30,6 +30,7 @@ backupFileProtocol(PackRead *const param, ProtocolServer *const server)
// Backup options that apply to all files
const String *const repoFile = pckReadStrP(param);
uint64_t bundleId = pckReadU64P(param);
const bool bundleRaw = bundleId != 0 ? pckReadBoolP(param) : false;
const unsigned int blockIncrReference = (unsigned int)pckReadU64P(param);
const CompressType repoFileCompressType = (CompressType)pckReadU32P(param);
const int repoFileCompressLevel = pckReadI32P(param);
@@ -72,7 +73,8 @@ backupFileProtocol(PackRead *const param, ProtocolServer *const server)
// Backup file
const List *const result = backupFile(
repoFile, bundleId, blockIncrReference, repoFileCompressType, repoFileCompressLevel, cipherType, cipherPass, fileList);
repoFile, bundleId, bundleRaw, blockIncrReference, repoFileCompressType, repoFileCompressLevel, cipherType, cipherPass,
fileList);
// Return result
PackWrite *const resultPack = protocolPackNew();
+8 -5
View File
@@ -27,8 +27,8 @@ Restore File
FN_EXTERN List *
restoreFile(
const String *const repoFile, const unsigned int repoIdx, const CompressType repoFileCompressType, const time_t copyTimeBegin,
const bool delta, const bool deltaForce, const String *const cipherPass, const StringList *const referenceList,
List *const fileList)
const bool delta, const bool deltaForce, const bool bundleRaw, const String *const cipherPass,
const StringList *const referenceList, List *const fileList)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
FUNCTION_LOG_PARAM(STRING, repoFile);
@@ -37,6 +37,7 @@ restoreFile(
FUNCTION_LOG_PARAM(TIME, copyTimeBegin);
FUNCTION_LOG_PARAM(BOOL, delta);
FUNCTION_LOG_PARAM(BOOL, deltaForce);
FUNCTION_LOG_PARAM(BOOL, bundleRaw);
FUNCTION_TEST_PARAM(STRING, cipherPass);
FUNCTION_LOG_PARAM(STRING_LIST, referenceList); // List of references (for block incremental)
FUNCTION_LOG_PARAM(LIST, fileList); // List of files to restore
@@ -403,7 +404,8 @@ restoreFile(
if (repoFileCompressType != compressTypeNone)
{
ioFilterGroupAdd(
ioReadFilterGroup(chunkedRead), decompressFilterP(repoFileCompressType));
ioReadFilterGroup(chunkedRead),
decompressFilterP(repoFileCompressType, .raw = true));
}
// Open chunked read
@@ -449,12 +451,13 @@ restoreFile(
if (cipherPass != NULL)
{
ioFilterGroupAdd(
filterGroup, cipherBlockNewP(cipherModeDecrypt, cipherTypeAes256Cbc, BUFSTR(cipherPass)));
filterGroup,
cipherBlockNewP(cipherModeDecrypt, cipherTypeAes256Cbc, BUFSTR(cipherPass), .raw = bundleRaw));
}
// Add decompression filter
if (repoFileCompressType != compressTypeNone)
ioFilterGroupAdd(filterGroup, decompressFilterP(repoFileCompressType));
ioFilterGroupAdd(filterGroup, decompressFilterP(repoFileCompressType, .raw = bundleRaw));
// Add sha1 filter
ioFilterGroupAdd(filterGroup, cryptoHashNew(hashTypeSha1));
+1 -1
View File
@@ -47,6 +47,6 @@ typedef struct RestoreFileResult
FN_EXTERN List *restoreFile(
const String *repoFile, unsigned int repoIdx, CompressType repoFileCompressType, time_t copyTimeBegin, bool delta,
bool deltaForce, const String *cipherPass, const StringList *referenceList, List *fileList);
bool deltaForce, bool bundleRaw, const String *cipherPass, const StringList *referenceList, List *fileList);
#endif
+3 -1
View File
@@ -33,6 +33,7 @@ restoreFileProtocol(PackRead *const param, ProtocolServer *const server)
const time_t copyTimeBegin = pckReadTimeP(param);
const bool delta = pckReadBoolP(param);
const bool deltaForce = pckReadBoolP(param);
const bool bundleRaw = pckReadBoolP(param);
const String *const cipherPass = pckReadStrP(param);
const StringList *const referenceList = pckReadStrLstP(param);
@@ -69,7 +70,8 @@ restoreFileProtocol(PackRead *const param, ProtocolServer *const server)
// Restore files
const List *const result = restoreFile(
repoFile, repoIdx, repoFileCompressType, copyTimeBegin, delta, deltaForce, cipherPass, referenceList, fileList);
repoFile, repoIdx, repoFileCompressType, copyTimeBegin, delta, deltaForce, bundleRaw, cipherPass, referenceList,
fileList);
// Return result
PackWrite *const resultPack = protocolPackNew();
+1
View File
@@ -2346,6 +2346,7 @@ restoreJobCallback(void *data, unsigned int clientIdx)
pckWriteTimeP(param, manifestData(jobData->manifest)->backupTimestampCopyStart);
pckWriteBoolP(param, cfgOptionBool(cfgOptDelta));
pckWriteBoolP(param, cfgOptionBool(cfgOptDelta) && cfgOptionBool(cfgOptForce));
pckWriteBoolP(param, file.bundleId != 0 && manifestData(jobData->manifest)->bundleRaw);
pckWriteStrP(param, jobData->cipherSubPass);
pckWriteStrLstP(param, manifestReferenceList(jobData->manifest));
+14
View File
@@ -1270,6 +1270,7 @@ manifestNewBuild(
this->pub.data.backupOptionOnline = online;
this->pub.data.backupOptionChecksumPage = varNewBool(checksumPage);
this->pub.data.bundle = bundle;
this->pub.data.bundleRaw = blockIncr;
this->pub.data.blockIncr = blockIncr;
MEM_CONTEXT_TEMP_BEGIN()
@@ -1547,6 +1548,9 @@ manifestBuildIncr(Manifest *this, const Manifest *manifestPrior, BackupType type
// Set diff/incr backup type
this->pub.data.backupType = type;
// Bundle raw must not change in a backup set
this->pub.data.bundleRaw = manifestPrior->pub.data.bundleRaw;
}
MEM_CONTEXT_END();
@@ -1790,6 +1794,7 @@ manifestBuildComplete(
#define MANIFEST_KEY_BACKUP_ARCHIVE_STOP "backup-archive-stop"
#define MANIFEST_KEY_BACKUP_BLOCK_INCR "backup-block-incr"
#define MANIFEST_KEY_BACKUP_BUNDLE "backup-bundle"
#define MANIFEST_KEY_BACKUP_BUNDLE_RAW "backup-bundle-raw"
#define MANIFEST_KEY_BACKUP_LABEL "backup-label"
#define MANIFEST_KEY_BACKUP_LSN_START "backup-lsn-start"
#define MANIFEST_KEY_BACKUP_LSN_STOP "backup-lsn-stop"
@@ -2199,6 +2204,8 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
manifest->pub.data.blockIncr = varBool(jsonToVar(value));
else if (strEqZ(key, MANIFEST_KEY_BACKUP_BUNDLE))
manifest->pub.data.bundle = varBool(jsonToVar(value));
else if (strEqZ(key, MANIFEST_KEY_BACKUP_BUNDLE_RAW))
manifest->pub.data.bundleRaw = varBool(jsonToVar(value));
else if (strEqZ(key, MANIFEST_KEY_BACKUP_LABEL))
manifest->pub.data.backupLabel = varStr(jsonToVar(value));
else if (strEqZ(key, MANIFEST_KEY_BACKUP_LSN_START))
@@ -2446,6 +2453,13 @@ manifestSaveCallback(void *const callbackData, const String *const sectionNext,
{
infoSaveValue(
infoSaveData, MANIFEST_SECTION_BACKUP, MANIFEST_KEY_BACKUP_BUNDLE, jsonFromVar(VARBOOL(manifest->pub.data.bundle)));
if (manifest->pub.data.bundleRaw)
{
infoSaveValue(
infoSaveData, MANIFEST_SECTION_BACKUP, MANIFEST_KEY_BACKUP_BUNDLE_RAW,
jsonFromVar(VARBOOL(manifest->pub.data.bundleRaw)));
}
}
infoSaveValue(
+1
View File
@@ -56,6 +56,7 @@ typedef struct ManifestData
time_t backupTimestampStop; // When did the backup stop?
BackupType backupType; // Type of backup: full, diff, incr
bool bundle; // Does the backup bundle files?
bool bundleRaw; // Use raw compress/encrypt for bundling?
bool blockIncr; // Does the backup perform block incremental?
// ??? Note that these fields are redundant and verbose since storing the start/stop lsn as a uint64 would be sufficient.
@@ -2162,6 +2162,13 @@ sub restoreCompare
$oExpectedManifestRef->{&MANIFEST_SECTION_BACKUP}{'backup-bundle'});
}
if (defined($oExpectedManifestRef->{&MANIFEST_SECTION_BACKUP}{'backup-bundle-raw'}))
{
$oActualManifest->set(
MANIFEST_SECTION_BACKUP, 'backup-bundle-raw', undef,
$oExpectedManifestRef->{&MANIFEST_SECTION_BACKUP}{'backup-bundle-raw'});
}
# Delete block incr headers since old Perl manifest code will not generate them
delete($oExpectedManifestRef->{&MANIFEST_SECTION_BACKUP}{'backup-block-incr'});
delete($oExpectedManifestRef->{&MANIFEST_SECTION_BACKUP}{'backup-block-incr-size'});
+26 -19
View File
@@ -191,7 +191,8 @@ testBackupValidateList(
if (manifestData->backupOptionCompressType != compressTypeNone)
{
ioFilterGroupAdd(
ioReadFilterGroup(chunkRead), decompressFilterP(manifestData->backupOptionCompressType));
ioReadFilterGroup(chunkRead),
decompressFilterP(manifestData->backupOptionCompressType, .raw = true));
}
ioReadOpen(chunkRead);
@@ -236,14 +237,20 @@ testBackupValidateList(
StorageRead *read = storageNewReadP(
storage, strNewFmt("%s/%s", strZ(path), strZ(info.name)), .offset = file.bundleOffset,
.limit = VARUINT64(file.sizeRepo));
const bool raw = bundle && manifest->pub.data.bundleRaw;
cipherBlockFilterGroupAdd(
ioReadFilterGroup(storageReadIo(read)), cipherType, cipherModeDecrypt, cipherPass);
if (cipherType != cipherTypeNone)
{
ioFilterGroupAdd(
ioReadFilterGroup(storageReadIo(read)),
cipherBlockNewP(cipherModeDecrypt, cipherType, BUFSTR(cipherPass), .raw = raw));
}
if (manifestData->backupOptionCompressType != compressTypeNone)
{
ioFilterGroupAdd(
ioReadFilterGroup(storageReadIo(read)), decompressFilterP(manifestData->backupOptionCompressType));
ioReadFilterGroup(storageReadIo(read)),
decompressFilterP(manifestData->backupOptionCompressType, .raw = raw));
}
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), cryptoHashNew(hashTypeSha1));
@@ -1252,7 +1259,7 @@ testRun(void)
blockIncrNewPack(
ioFilterParamList(
blockIncrNew(
3, 2, 4, 5, NULL, compressFilterP(compressTypeGz, 1),
3, 2, 4, 5, NULL, compressFilterP(compressTypeGz, 1, .raw = true),
cipherBlockNewP(cipherModeEncrypt, cipherTypeAes256Cbc, BUFSTRDEF(TEST_CIPHER_PASS), .raw = true)))),
"block incr pack");
}
@@ -1301,7 +1308,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
"pg file missing, ignoreMissing=true, no delta");
TEST_RESULT_UINT(result.copySize + result.repoSize, 0, "copy/repo size 0");
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultSkip, "skip file");
@@ -1326,7 +1333,7 @@ testRun(void)
lstAdd(fileList, &file);
TEST_ERROR(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), FileMissingError,
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), FileMissingError,
"unable to open missing file '" TEST_PATH "/pg/missing' for read");
// Create a pg file to backup
@@ -1363,7 +1370,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
"file checksummed with pageChecksum enabled");
TEST_RESULT_UINT(result.copySize, 9, "copy=pgFile size");
TEST_RESULT_UINT(result.repoSize, 9, "repo=pgFile size");
@@ -1395,7 +1402,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
"backup file");
TEST_RESULT_UINT(result.copySize, 12, "copy size");
TEST_RESULT_UINT(result.repoSize, 12, "repo size");
@@ -1428,7 +1435,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
"file in db and repo, checksum equal, no ignoreMissing, no pageChecksum, delta, hasReference");
TEST_RESULT_UINT(result.copySize, 9, "copy size set");
TEST_RESULT_UINT(result.repoSize, 0, "repo size not set since already exists in repo");
@@ -1462,7 +1469,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
"file in db and repo, pg checksum not equal, no ignoreMissing, no pageChecksum, delta, hasReference");
TEST_RESULT_UINT(result.copySize, 9, "copy 9 bytes");
TEST_RESULT_UINT(result.repoSize, 9, "repo=copy size");
@@ -1497,7 +1504,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
"db & repo file, pg checksum same, pg size different, no ignoreMissing, no pageChecksum, delta, hasReference");
TEST_RESULT_UINT(result.copySize, 12, "copy=pgFile size");
TEST_RESULT_UINT(result.repoSize, 12, "repo=pgFile size");
@@ -1537,7 +1544,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
"file in repo only, checksum in repo equal, ignoreMissing=true, no pageChecksum, delta, no hasReference");
TEST_RESULT_UINT(result.copySize + result.repoSize, 0, "copy=repo=0 size");
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultSkip, "skip file");
@@ -1570,7 +1577,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeGz, 3, cipherTypeNone, NULL, fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeGz, 3, cipherTypeNone, NULL, fileList), 0),
"pg file exists, no checksum, no ignoreMissing, compression, no pageChecksum, no delta, no hasReference");
TEST_RESULT_UINT(result.copySize, 9, "copy=pgFile size");
TEST_RESULT_UINT(result.repoSize, 29, "repo compress size");
@@ -1610,7 +1617,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeNone, NULL, fileList), 0),
"zero-sized pg file exists, no repo file, no ignoreMissing, no pageChecksum, no delta, no hasReference");
TEST_RESULT_UINT(result.copySize + result.repoSize, 0, "copy=repo=pgFile size 0");
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultCopy, "copy file");
@@ -1661,7 +1668,7 @@ testRun(void)
TEST_ASSIGN(
result,
*(BackupFileResult *)lstGet(
backupFile(repoFile, 0, 0, compressTypeNone, 1, cipherTypeAes256Cbc, STRDEF(TEST_CIPHER_PASS), fileList), 0),
backupFile(repoFile, 0, false, 0, compressTypeNone, 1, cipherTypeAes256Cbc, STRDEF(TEST_CIPHER_PASS), fileList), 0),
"pg file exists, no repo file, no ignoreMissing, no pageChecksum, no delta, no hasReference");
TEST_RESULT_UINT(result.copySize, 9, "copy size set");
TEST_RESULT_UINT(result.repoSize, 32, "repo size set");
@@ -3938,7 +3945,7 @@ testRun(void)
"P00 INFO: check archive for segment 0000000105DC520000000000\n"
"P01 DETAIL: backup file " TEST_PATH "/pg1/block-incr-grow (128KB, [PCT]) checksum [SHA1]\n"
"P01 DETAIL: backup file " TEST_PATH "/pg1/PG_VERSION (bundle 1/0, 2B, [PCT]) checksum [SHA1]\n"
"P01 DETAIL: backup file " TEST_PATH "/pg1/global/pg_control (bundle 1/48, 8KB, [PCT]) checksum [SHA1]\n"
"P01 DETAIL: backup file " TEST_PATH "/pg1/global/pg_control (bundle 1/24, 8KB, [PCT]) checksum [SHA1]\n"
"P00 INFO: execute non-exclusive backup stop and wait for all WAL segments to archive\n"
"P00 INFO: backup stop archive = 0000000105DC520000000001, lsn = 5dc5200/300000\n"
"P00 DETAIL: wrote 'backup_label' file returned from backup stop function\n"
@@ -4027,8 +4034,8 @@ testRun(void)
"P00 INFO: backup start archive = 0000000105DC82D000000000, lsn = 5dc82d0/0\n"
"P00 INFO: check archive for segment 0000000105DC82D000000000\n"
"P01 DETAIL: backup file " TEST_PATH "/pg1/block-age-multiplier (bundle 1/0, 256KB, [PCT]) checksum [SHA1]\n"
"P01 DETAIL: backup file " TEST_PATH "/pg1/global/pg_control (bundle 1/355, 8KB, [PCT]) checksum [SHA1]\n"
"P01 DETAIL: backup file " TEST_PATH "/pg1/block-incr-grow (bundle 1/467, 256KB, [PCT]) checksum [SHA1]\n"
"P01 DETAIL: backup file " TEST_PATH "/pg1/global/pg_control (bundle 1/339, 8KB, [PCT]) checksum [SHA1]\n"
"P01 DETAIL: backup file " TEST_PATH "/pg1/block-incr-grow (bundle 1/427, 256KB, [PCT]) checksum [SHA1]\n"
"P00 DETAIL: reference pg_data/PG_VERSION to 20191108-080000F\n"
"P00 INFO: execute non-exclusive backup stop and wait for all WAL segments to archive\n"
"P00 INFO: backup stop archive = 0000000105DC82D000000001, lsn = 5dc82d0/300000\n"
+1 -1
View File
@@ -246,7 +246,7 @@ testRun(void)
TEST_ERROR(
restoreFile(
strNewFmt(STORAGE_REPO_BACKUP "/%s/%s.gz", strZ(repoFileReferenceFull), strZ(repoFile1)), repoIdx, compressTypeGz,
0, false, false, STRDEF("badpass"), NULL, fileList),
0, false, false, false, STRDEF("badpass"), NULL, fileList),
ChecksumError,
"error restoring 'normal': actual checksum 'd1cd8a7d11daa26814b93eb604e1d49ab4b43770' does not match expected checksum"
" 'ffffffffffffffffffffffffffffffffffffffff'");
+16 -2
View File
@@ -59,6 +59,7 @@ testRun(void)
"[backup]\n" \
"backup-block-incr=true\n" \
"backup-bundle=true\n" \
"backup-bundle-raw=true\n" \
"backup-label=null\n" \
"backup-reference=\"\"\n" \
"backup-timestamp-copy-start=0\n" \
@@ -668,7 +669,7 @@ testRun(void)
TEST_ASSIGN(
manifest,
manifestNewBuild(
storagePg, PG_VERSION_12, hrnPgCatalogVersion(PG_VERSION_12), 0, true, false, false, false, NULL, NULL, NULL),
storagePg, PG_VERSION_12, hrnPgCatalogVersion(PG_VERSION_12), 0, true, false, true, false, NULL, NULL, NULL),
"build manifest");
contentSave = bufNew(0);
@@ -677,7 +678,14 @@ testRun(void)
strNewBuf(contentSave),
strNewBuf(
harnessInfoChecksumZ(
TEST_MANIFEST_HEADER
"[backup]\n"
"backup-bundle=true\n"
"backup-label=null\n"
"backup-reference=\"\"\n"
"backup-timestamp-copy-start=0\n"
"backup-timestamp-start=0\n"
"backup-timestamp-stop=0\n"
"backup-type=\"full\"\n"
TEST_MANIFEST_DB_12
TEST_MANIFEST_OPTION_ARCHIVE
TEST_MANIFEST_OPTION_CHECKSUM_PAGE_FALSE
@@ -1054,6 +1062,8 @@ testRun(void)
manifestPrior = manifestNewInternal();
manifestPrior->pub.data.backupLabel = strNewZ("20190101-010101F");
strLstAdd(manifestPrior->pub.referenceList, manifestPrior->pub.data.backupLabel);
manifestPrior->pub.data.bundle = true;
manifestPrior->pub.data.bundleRaw = true;
HRN_MANIFEST_FILE_ADD(
manifestPrior, .name = MANIFEST_TARGET_PGDATA "/FILE3", .size = 0, .sizeRepo = 0, .timestamp = 1482182860,
@@ -1402,6 +1412,8 @@ testRun(void)
// Manifest with minimal features
const Buffer *contentLoad = harnessInfoChecksumZ(
"[backup]\n"
"backup-bundle=true\n"
"backup-bundle-raw=true\n"
"backup-label=\"20190808-163540F\"\n"
"backup-reference=\"20190808-163540F\"\n"
"backup-timestamp-copy-start=1565282141\n"
@@ -1486,6 +1498,7 @@ testRun(void)
"backup-archive-stop=\"000000030000028500000089\"\n" \
"backup-block-incr=true\n" \
"backup-bundle=true\n" \
"backup-bundle-raw=true\n" \
"backup-label=\"20190818-084502F_20190820-084502D\"\n" \
"backup-lsn-start=\"285/89000028\"\n" \
"backup-lsn-stop=\"285/89001F88\"\n" \
@@ -1609,6 +1622,7 @@ testRun(void)
"backup-archive-stop=\"000000040000028500000089\"\n"
"backup-block-incr=true\n"
"backup-bundle=true\n"
"backup-bundle-raw=true\n"
"backup-label=\"20190818-084502F_20190820-084502D\"\n"
"backup-lsn-start=\"300/89000028\"\n"
"backup-lsn-stop=\"300/89001F88\"\n"