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

Add backup size completed/total to info command JSON output.

This allows for backup progress to be monitored by external processes, whereas before backup progress was only available via text output.
This commit is contained in:
Stefan Fercot
2023-08-31 22:36:52 +02:00
committed by GitHub
parent fbd992adc7
commit e3fcd8cd9e
7 changed files with 82 additions and 19 deletions

View File

@ -1025,7 +1025,11 @@ testRun(void)
{
lockInit(cfgOptionStr(cfgOptLockPath), STRDEF("999-ffffffff"), STRDEF("stanza2"), lockTypeBackup);
TEST_RESULT_INT_NE(lockAcquireP(), -1, "create backup/expire lock");
TEST_RESULT_VOID(lockWriteDataP(lockTypeBackup, .percentComplete = VARUINT(4545)), "write lock data");
TEST_RESULT_VOID(
lockWriteDataP(
lockTypeBackup, .percentComplete = VARUINT(4545), .sizeComplete = VARUINT64(1435765),
.size = VARUINT64(3159000)),
"write lock data");
// Notify parent that lock has been acquired
HRN_FORK_CHILD_NOTIFY_PUT();
@ -1365,7 +1369,7 @@ testRun(void)
"],"
"\"status\":{"
"\"code\":4,"
"\"lock\":{\"backup\":{\"held\":true}},"
"\"lock\":{\"backup\":{\"held\":true,\"size\":3159000,\"size-cplt\":1435765}},"
"\"message\":\"different across repos\""
"}"
"},"