diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c index f0f88838dc2..bde795aaef0 100644 --- a/src/backend/backup/basebackup.c +++ b/src/backend/backup/basebackup.c @@ -674,8 +674,6 @@ perform_base_backup(basebackup_options *opt, bbsink *sink, /* clean up the resource owner we created */ ReleaseAuxProcessResources(true); - - basebackup_progress_done(); } /* diff --git a/src/backend/backup/basebackup_progress.c b/src/backend/backup/basebackup_progress.c index 1d22b541f89..e829d0626a4 100644 --- a/src/backend/backup/basebackup_progress.c +++ b/src/backend/backup/basebackup_progress.c @@ -38,6 +38,7 @@ static void bbsink_progress_begin_backup(bbsink *sink); static void bbsink_progress_archive_contents(bbsink *sink, size_t len); static void bbsink_progress_end_archive(bbsink *sink); +static void bbsink_progress_cleanup(bbsink *sink); static const bbsink_ops bbsink_progress_ops = { .begin_backup = bbsink_progress_begin_backup, @@ -48,7 +49,7 @@ static const bbsink_ops bbsink_progress_ops = { .manifest_contents = bbsink_forward_manifest_contents, .end_manifest = bbsink_forward_end_manifest, .end_backup = bbsink_forward_end_backup, - .cleanup = bbsink_forward_cleanup + .cleanup = bbsink_progress_cleanup }; /* @@ -179,6 +180,16 @@ bbsink_progress_archive_contents(bbsink *sink, size_t len) pgstat_progress_update_multi_param(nparam, index, val); } +/* + * Clean up progress reporting. + */ +static void +bbsink_progress_cleanup(bbsink *sink) +{ + pgstat_progress_end_command(); + bbsink_forward_cleanup(sink); +} + /* * Advertise that we are waiting for the start-of-backup checkpoint. */ @@ -231,12 +242,3 @@ basebackup_progress_transfer_wal(void) pgstat_progress_update_param(PROGRESS_BASEBACKUP_PHASE, PROGRESS_BASEBACKUP_PHASE_TRANSFER_WAL); } - -/* - * Advertise that we are no longer performing a backup. - */ -void -basebackup_progress_done(void) -{ - pgstat_progress_end_command(); -} diff --git a/src/include/backup/basebackup_sink.h b/src/include/backup/basebackup_sink.h index 8a5ee996a45..a298a79684d 100644 --- a/src/include/backup/basebackup_sink.h +++ b/src/include/backup/basebackup_sink.h @@ -296,6 +296,5 @@ extern void basebackup_progress_wait_checkpoint(void); extern void basebackup_progress_estimate_backup_size(void); extern void basebackup_progress_wait_wal_archive(bbsink_state *); extern void basebackup_progress_transfer_wal(void); -extern void basebackup_progress_done(void); #endif