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

Make archive-get locality error generate a global.error file.

Moving this error into the try block ensures that a global.error file is generated, which will be seen by archive-get.
This commit is contained in:
David Steele
2021-01-08 16:29:56 -05:00
parent 7d3d6ecbe1
commit 8567b7f733
2 changed files with 8 additions and 4 deletions

View File

@ -319,6 +319,8 @@ testRun(void)
TEST_ERROR(cmdArchiveGetAsync(), ParamInvalidError, "at least one wal segment is required");
TEST_STORAGE_LIST(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_IN, "global.error\n", .remove = true);
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("command must be run on the pg host");
@ -326,7 +328,7 @@ testRun(void)
hrnCfgArgRawZ(argList, cfgOptPgHost, "host");
hrnCfgArgRawZ(argList, cfgOptPgPath, "/pg");
hrnCfgArgRawZ(argList, cfgOptRepoPath, "/repo");
strLstAddZ(argList, "--" CFGOPT_SPOOL_PATH "=/spool");
hrnCfgArgRawZ(argList, cfgOptSpoolPath, TEST_PATH "/spool");
strLstAddZ(argList, "--" CFGOPT_ARCHIVE_ASYNC);
strLstAddZ(argList, "--" CFGOPT_STANZA "=test2");
strLstAddZ(argList, "000000010000000100000001");
@ -334,6 +336,8 @@ testRun(void)
TEST_ERROR(cmdArchiveGetAsync(), HostInvalidError, "archive-get command must be run on the PostgreSQL host");
TEST_STORAGE_LIST(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_IN, "global.error\n", .remove = true);
// Create pg_control file and archive.info
// -------------------------------------------------------------------------------------------------------------------------
storagePutP(