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

Allow warnings to be written by archiveAsyncStatusOkWrite().

Migrate this feature to the C code since archive-push will need it.
This commit is contained in:
David Steele
2019-03-25 09:17:15 +04:00
parent 8820d69574
commit 444b4f8640
5 changed files with 24 additions and 10 deletions

View File

@ -138,13 +138,22 @@ testRun(void)
"remove global error");
TEST_RESULT_VOID(
archiveAsyncStatusOkWrite(archiveModeGet, walSegment), "write ok file");
archiveAsyncStatusOkWrite(archiveModeGet, walSegment, NULL), "write ok file");
TEST_RESULT_STR(
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"))))),
"", "check ok");
TEST_RESULT_VOID(
storageRemoveP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"), .errorOnMissing = true),
"remove ok");
TEST_RESULT_VOID(
archiveAsyncStatusOkWrite(archiveModeGet, walSegment, strNew("WARNING")), "write ok file with warning");
TEST_RESULT_STR(
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"))))),
"0\nWARNING", "check ok warning");
TEST_RESULT_VOID(
storageRemoveP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"), .errorOnMissing = true),
"remove ok");
}
// *****************************************************************************************************************************