1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-13 01:00:23 +02:00

Add additional detail to warnings when delta checksum is auto-enabled.

Hopefully this will help with debugging when it is not clear why delta checksum is being enabled.
This commit is contained in:
David Steele
2022-05-18 08:48:48 -04:00
parent 5dfd00bb6c
commit 83af3f1b7a
3 changed files with 19 additions and 9 deletions

View File

@ -1344,7 +1344,8 @@ manifestBuildValidate(Manifest *this, bool delta, time_t copyStart, CompressType
if (file.timestamp > copyStart) if (file.timestamp > copyStart)
{ {
LOG_WARN_FMT( LOG_WARN_FMT(
"file '%s' has timestamp in the future, enabling delta checksum", strZ(manifestPathPg(file.name))); "file '%s' has timestamp (%" PRId64 ") in the future (relative to copy start %" PRId64 "), enabling delta"
" checksum", strZ(manifestPathPg(file.name)), (int64_t)file.timestamp, (int64_t)copyStart);
this->pub.data.backupOptionDelta = BOOL_TRUE_VAR; this->pub.data.backupOptionDelta = BOOL_TRUE_VAR;
break; break;
@ -1424,8 +1425,9 @@ manifestBuildIncr(Manifest *this, const Manifest *manifestPrior, BackupType type
if (file.timestamp < filePrior.timestamp) if (file.timestamp < filePrior.timestamp)
{ {
LOG_WARN_FMT( LOG_WARN_FMT(
"file '%s' has timestamp earlier than prior backup, enabling delta checksum", "file '%s' has timestamp earlier than prior backup (prior %" PRId64 ", current %" PRId64 "), enabling"
strZ(manifestPathPg(file.name))); " delta checksum",
strZ(manifestPathPg(file.name)), (int64_t)filePrior.timestamp, (int64_t)file.timestamp);
this->pub.data.backupOptionDelta = BOOL_TRUE_VAR; this->pub.data.backupOptionDelta = BOOL_TRUE_VAR;
break; break;
@ -1435,8 +1437,9 @@ manifestBuildIncr(Manifest *this, const Manifest *manifestPrior, BackupType type
if (file.size != filePrior.size && file.timestamp == filePrior.timestamp) if (file.size != filePrior.size && file.timestamp == filePrior.timestamp)
{ {
LOG_WARN_FMT( LOG_WARN_FMT(
"file '%s' has same timestamp as prior but different size, enabling delta checksum", "file '%s' has same timestamp (%" PRId64 ") as prior but different size (prior %" PRIu64 ", current"
strZ(manifestPathPg(file.name))); " %" PRIu64 "), enabling delta checksum",
strZ(manifestPathPg(file.name)), (int64_t)file.timestamp, filePrior.size, file.size);
this->pub.data.backupOptionDelta = BOOL_TRUE_VAR; this->pub.data.backupOptionDelta = BOOL_TRUE_VAR;
break; break;

View File

@ -2566,7 +2566,8 @@ testRun(void)
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the next regular checkpoint completes\n" "P00 INFO: execute exclusive pg_start_backup(): backup begins after the next regular checkpoint completes\n"
"P00 INFO: backup start archive = 0000000105D9759000000000, lsn = 5d97590/0\n" "P00 INFO: backup start archive = 0000000105D9759000000000, lsn = 5d97590/0\n"
"P00 INFO: check archive for prior segment 0000000105D9758F000000FF\n" "P00 INFO: check archive for prior segment 0000000105D9758F000000FF\n"
"P00 WARN: file 'time-mismatch2' has timestamp in the future, enabling delta checksum\n" "P00 WARN: file 'time-mismatch2' has timestamp (1570200100) in the future (relative to copy start 1570200000),"
" enabling delta checksum\n"
"P00 WARN: resumable backup 20191003-105320F_20191004-144000D of same type exists" "P00 WARN: resumable backup 20191003-105320F_20191004-144000D of same type exists"
" -- remove invalid files and resume\n" " -- remove invalid files and resume\n"
"P00 DETAIL: remove file '" TEST_PATH "/repo/backup/test1/20191003-105320F_20191004-144000D/pg_data/PG_VERSION.gz'" "P00 DETAIL: remove file '" TEST_PATH "/repo/backup/test1/20191003-105320F_20191004-144000D/pg_data/PG_VERSION.gz'"

View File

@ -982,7 +982,9 @@ testRun(void)
TEST_RESULT_BOOL(varBool(manifest->pub.data.backupOptionDelta), true, "check delta"); TEST_RESULT_BOOL(varBool(manifest->pub.data.backupOptionDelta), true, "check delta");
TEST_RESULT_UINT(manifest->pub.data.backupOptionCompressType, compressTypeGz, "check compress"); TEST_RESULT_UINT(manifest->pub.data.backupOptionCompressType, compressTypeGz, "check compress");
TEST_RESULT_LOG("P00 WARN: file 'PG_VERSION' has timestamp in the future, enabling delta checksum"); TEST_RESULT_LOG(
"P00 WARN: file 'PG_VERSION' has timestamp (1482182860) in the future (relative to copy start 1482182859), enabling"
" delta checksum");
} }
// ***************************************************************************************************************************** // *****************************************************************************************************************************
@ -1197,7 +1199,9 @@ testRun(void)
TEST_RESULT_VOID(manifestBuildIncr(manifest, manifestPrior, backupTypeIncr, NULL), "incremental manifest"); TEST_RESULT_VOID(manifestBuildIncr(manifest, manifestPrior, backupTypeIncr, NULL), "incremental manifest");
TEST_RESULT_LOG("P00 WARN: file 'FILE1' has timestamp earlier than prior backup, enabling delta checksum"); TEST_RESULT_LOG(
"P00 WARN: file 'FILE1' has timestamp earlier than prior backup (prior 1482182860, current 1482182859), enabling"
" delta checksum");
contentSave = bufNew(0); contentSave = bufNew(0);
TEST_RESULT_VOID(manifestSave(manifest, ioBufferWriteNew(contentSave)), "save manifest"); TEST_RESULT_VOID(manifestSave(manifest, ioBufferWriteNew(contentSave)), "save manifest");
@ -1249,7 +1253,9 @@ testRun(void)
manifestBuildIncr(manifest, manifestPrior, backupTypeIncr, STRDEF("000000040000000400000004")), manifestBuildIncr(manifest, manifestPrior, backupTypeIncr, STRDEF("000000040000000400000004")),
"incremental manifest"); "incremental manifest");
TEST_RESULT_LOG("P00 WARN: file 'FILE2' has same timestamp as prior but different size, enabling delta checksum"); TEST_RESULT_LOG(
"P00 WARN: file 'FILE2' has same timestamp (1482182860) as prior but different size (prior 4, current 6), enabling"
" delta checksum");
contentSave = bufNew(0); contentSave = bufNew(0);
TEST_RESULT_VOID(manifestSave(manifest, ioBufferWriteNew(contentSave)), "save manifest"); TEST_RESULT_VOID(manifestSave(manifest, ioBufferWriteNew(contentSave)), "save manifest");