1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-03 00:26:59 +02:00

Add ClockError for unexpected clock skew and timezone changes.

A distinct result code should help debugging of clock skew and timezone issues.
This commit is contained in:
David Steele
2022-05-05 10:19:11 -04:00
committed by GitHub
parent b6bfd9f99d
commit 5f8c9cd66a
6 changed files with 22 additions and 3 deletions

View File

@ -1458,7 +1458,7 @@ testRun(void)
strNewFmt(STORAGE_REPO_BACKUP "/%s", strZ(backupLabelFormat(backupTypeFull, NULL, timestamp + 1)))));
TEST_ERROR(
backupLabelCreate(backupTypeFull, NULL, timestamp), FormatError,
backupLabelCreate(backupTypeFull, NULL, timestamp), ClockError,
"new backup label '20191203-193413F' is not later than latest backup label '20191203-193413F'\n"
"HINT: has the timezone changed?\n"
"HINT: is there clock skew?");
@ -1472,7 +1472,7 @@ testRun(void)
strZ(backupLabelFormat(backupTypeFull, NULL, timestamp + 3600)))));
TEST_ERROR(
backupLabelCreate(backupTypeFull, NULL, timestamp), FormatError,
backupLabelCreate(backupTypeFull, NULL, timestamp), ClockError,
"new backup label '20191203-193413F' is not later than latest backup label '20191203-203412F'\n"
"HINT: has the timezone changed?\n"
"HINT: is there clock skew?");