summaryrefslogtreecommitdiff
path: root/src/backend/backup
diff options
context:
space:
mode:
authorAndres Freund2024-10-08 15:37:45 +0000
committerAndres Freund2024-10-08 15:37:45 +0000
commit57f37024712702350b714cf64215077f1d75c568 (patch)
tree7f7ed06961747eaad8f7c0d53bb304c954c7b4ea /src/backend/backup
parent755a4c10d19dbe432a1860cced914c570ff3becc (diff)
Use aux process resource owner in walsender
AIO will need a resource owner to do IO. Right now we create a resowner on-demand during basebackup, and we could do the same for AIO. But it seems easier to just always create an aux process resowner. Reviewed-by: Heikki Linnakangas <[email protected]> Reviewed-by: Noah Misch <[email protected]> Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/backup')
-rw-r--r--src/backend/backup/basebackup.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c
index 14e5ba72e97..0f8cddcbeeb 100644
--- a/src/backend/backup/basebackup.c
+++ b/src/backend/backup/basebackup.c
@@ -250,8 +250,10 @@ perform_base_backup(basebackup_options *opt, bbsink *sink,
state.bytes_total_is_valid = false;
/* we're going to use a BufFile, so we need a ResourceOwner */
- Assert(CurrentResourceOwner == NULL);
- CurrentResourceOwner = ResourceOwnerCreate(NULL, "base backup");
+ Assert(AuxProcessResourceOwner != NULL);
+ Assert(CurrentResourceOwner == AuxProcessResourceOwner ||
+ CurrentResourceOwner == NULL);
+ CurrentResourceOwner = AuxProcessResourceOwner;
backup_started_in_recovery = RecoveryInProgress();
@@ -672,7 +674,7 @@ perform_base_backup(basebackup_options *opt, bbsink *sink,
FreeBackupManifest(&manifest);
/* clean up the resource owner we created */
- WalSndResourceCleanup(true);
+ ReleaseAuxProcessResources(true);
basebackup_progress_done();
}