1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00

Exclude backup set size from info for block incremental backups.

As calculated this size is not correct since it does not include the parts of prior block incrementals that are required to make the current block incremental valid. At best this could be approximated and the resulting values might be very confusing.

For now, at least, exclude this metric for block incremental backups.
This commit is contained in:
David Steele 2023-03-09 10:30:57 +07:00
parent 210bed4511
commit 6252c0e448
3 changed files with 15 additions and 11 deletions

View File

@ -49,6 +49,7 @@
<github-pull-request id="2011"/>
</commit>
<commit subject="Use xxHash instead of SHA-1 for block incremental checksums."/>
<commit subject="Exclude backup set size from info for block incremental backups."/>
<release-item-contributor-list>
<release-item-contributor id="david.steele"/>

View File

@ -453,7 +453,9 @@ backupListAdd(
// info:repository section
KeyValue *repoInfo = kvPutKv(infoInfo, INFO_KEY_REPOSITORY_VAR);
kvPut(repoInfo, KEY_SIZE_VAR, VARUINT64(backupData->backupInfoRepoSize));
if (backupData->backupInfoRepoSizeMap == NULL)
kvPut(repoInfo, KEY_SIZE_VAR, VARUINT64(backupData->backupInfoRepoSize));
kvPut(repoInfo, KEY_DELTA_VAR, VARUINT64(backupData->backupInfoRepoSizeDelta));
if (outputJson && backupData->backupInfoRepoSizeMap != NULL)
@ -885,12 +887,14 @@ formatTextBackup(const DbGroup *dbGroup, String *resultStr)
strZ(strSizeFormat(varUInt64Force(kvGet(info, KEY_DELTA_VAR)))));
KeyValue *repoInfo = varKv(kvGet(info, INFO_KEY_REPOSITORY_VAR));
const Variant *const repoSizeInfo = kvGet(repoInfo, KEY_SIZE_VAR);
strCatFmt(
resultStr, " repo%u: backup set size: %s, backup size: %s\n",
varUInt(kvGet(varKv(kvGet(backupInfo, KEY_DATABASE_VAR)), KEY_REPO_KEY_VAR)),
strZ(strSizeFormat(varUInt64Force(kvGet(repoInfo, KEY_SIZE_VAR)))),
strZ(strSizeFormat(varUInt64Force(kvGet(repoInfo, KEY_DELTA_VAR)))));
strCatFmt(resultStr, " repo%u: ", varUInt(kvGet(varKv(kvGet(backupInfo, KEY_DATABASE_VAR)), KEY_REPO_KEY_VAR)));
if (repoSizeInfo != NULL)
strCatFmt(resultStr, "backup set size: %s, ", strZ(strSizeFormat(varUInt64Force(kvGet(repoInfo, KEY_SIZE_VAR)))));
strCatFmt(resultStr, "backup size: %s\n", strZ(strSizeFormat(varUInt64Force(kvGet(repoInfo, KEY_DELTA_VAR)))));
if (kvGet(backupInfo, BACKUP_KEY_REFERENCE_VAR) != NULL)
{

View File

@ -1263,7 +1263,6 @@ testRun(void)
"\"repository\":{"
"\"delta\":346,"
"\"delta-map\":12,"
"\"size\":2369186,"
"\"size-map\":100"
"},"
"\"size\":20162900"
@ -1538,7 +1537,7 @@ testRun(void)
" timestamp start/stop: 2020-11-19 15:21:00 / 2020-11-19 15:21:03\n"
" wal start/stop: 000000010000000000000005 / 000000010000000000000005\n"
" database size: 19.2MB, database backup size: 8.2KB\n"
" repo1: backup set size: 2.3MB, backup size: 346B\n"
" repo1: backup size: 346B\n"
" backup reference list: 20201116-155000F\n"
"\n"
"stanza: stanza2\n"
@ -2364,7 +2363,7 @@ testRun(void)
" timestamp start/stop: 2020-11-19 15:21:00 / 2020-11-19 15:21:03\n"
" wal start/stop: 000000010000000000000005 / 000000010000000000000005\n"
" database size: 19.2MB, database backup size: 8.2KB\n"
" repo1: backup set size: 2.3MB, backup size: 346B\n"
" repo1: backup size: 346B\n"
" backup reference list: 20201116-155000F\n"
" database list: none\n"
" annotation(s)\n"
@ -2525,7 +2524,7 @@ testRun(void)
" timestamp start/stop: 2020-11-19 15:21:00 / 2020-11-19 15:21:03\n"
" wal start/stop: 000000010000000000000005 / 000000010000000000000005\n"
" database size: 19.2MB, database backup size: 8.2KB\n"
" repo1: backup set size: 2.3MB, backup size: 346B\n"
" repo1: backup size: 346B\n"
" backup reference list: 20201116-155000F\n",
"text - multi-repo, valid backups only on repo1");
@ -2582,7 +2581,7 @@ testRun(void)
" timestamp start/stop: 2020-11-19 15:21:00 / 2020-11-19 15:21:03\n"
" wal start/stop: 000000010000000000000005 / 000000010000000000000005\n"
" database size: 19.2MB, database backup size: 8.2KB\n"
" repo1: backup set size: 2.3MB, backup size: 346B\n"
" repo1: backup size: 346B\n"
" backup reference list: 20201116-155000F\n",
"text - multi-repo, prior backup: no archives but backups (code coverage)");