mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-01-30 05:39:12 +02:00
Check archive push queue limit before checking repository.
If the push queue limit has been exceeded then nothing will be pushed to the repo so there is no point in checking it. Worse, a failure in the check would cause drop not to run and potentially fill up the disk, exactly the case this feature was designed to prevent. The async version already checks the push queue limit before checking the repository so now both versions have the same behavior.
This commit is contained in:
parent
8cf47f82e4
commit
cbb9b8fd2b
@ -348,14 +348,6 @@ cmdArchivePush(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the repo storage in case it is remote and encryption settings need to be pulled down
|
||||
storageRepo();
|
||||
|
||||
// Get archive info
|
||||
ArchivePushCheckResult archiveInfo = archivePushCheck(
|
||||
cfgOptionTest(cfgOptPgPath), cipherType(cfgOptionStr(cfgOptRepoCipherType)),
|
||||
cfgOptionStrNull(cfgOptRepoCipherPass));
|
||||
|
||||
// Check if the push queue has been exceeded
|
||||
if (cfgOptionTest(cfgOptArchivePushQueueMax) &&
|
||||
archivePushDrop(strPath(walFile), archivePushReadyList(strPath(walFile))))
|
||||
@ -365,6 +357,14 @@ cmdArchivePush(void)
|
||||
// Else push the file
|
||||
else
|
||||
{
|
||||
// Get the repo storage in case it is remote and encryption settings need to be pulled down
|
||||
storageRepo();
|
||||
|
||||
// Get archive info
|
||||
ArchivePushCheckResult archiveInfo = archivePushCheck(
|
||||
cfgOptionTest(cfgOptPgPath), cipherType(cfgOptionStr(cfgOptRepoCipherType)),
|
||||
cfgOptionStrNull(cfgOptRepoCipherPass));
|
||||
|
||||
// Push the file to the archive
|
||||
String *warning = archivePushFile(
|
||||
walFile, archiveInfo.archiveId, archiveInfo.pgVersion, archiveInfo.pgSystemId, archiveFile,
|
||||
|
Loading…
x
Reference in New Issue
Block a user