1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00

Free no longer needed remotes so they do not timeout during restore.

The remotes are no longer needed in the main process after the manifest is loaded. If the restore is long enough the connection will timeout and WARN at the end of the restore. This is harmless for the restore but distracting for the user.

To prevent this, free the remotes once they are no longer needed.
This commit is contained in:
David Steele 2021-04-22 12:23:08 -04:00 committed by GitHub
parent 45f83558ea
commit 06fa18582a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -15,6 +15,19 @@
<release date="XXXX-XX-XX" version="2.34dev" title="UNDER DEVELOPMENT">
<release-core-list>
<release-bug-list>
<release-item>
<github-issue id="1368"/>
<github-pull-request id="1374"/>
<release-item-contributor-list>
<release-item-ideator id="francisco.miguel.biete"/>
<release-item-contributor id="david.steele"/>
<release-item-reviewer id="cynthia.shang"/>
</release-item-contributor-list>
<p>Free no longer needed remotes so they do not timeout during <cmd>restore</cmd>.</p>
</release-item>
<release-item>
<github-pull-request id="1375"/>
@ -9553,6 +9566,11 @@
<contributor-id type="github">fvannee</contributor-id>
</contributor>
<contributor id="francisco.miguel.biete">
<contributor-name-display>Francisco Miguel Biete</contributor-name-display>
<contributor-id type="github">fmbiete</contributor-id>
</contributor>
<contributor id="vidhya.gurumoorthi">
<contributor-name-display>Vidhya Gurumoorthi</contributor-name-display>
<contributor-id type="github">fpa-postgres</contributor-id>

View File

@ -2230,6 +2230,9 @@ cmdRestore(void)
strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE, strZ(backupData.backupSet)), backupData.repoCipherType,
backupData.backupCipherPass);
// Remotes (if any) are no longer needed since the rest of the repository reads will be done by the local processes
protocolFree();
// Validate manifest. Don't use strict mode because we'd rather ignore problems that won't affect a restore.
manifestValidate(jobData.manifest, false);