Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0282dc2

Browse files
committed
Ensure cleanup in case of early errors in streaming base backups
Move the code that sends the initial status information as well as thecalculation of paths inside the ENSURE_ERROR_CLEANUP block. If this codefailed, we would "leak" a counter of number of concurrent backups, therebymaking the system always believe it was in backup mode. This could happenif the sending failed (which it probably never did given that the smallamount of data to send would never cause a flush). It is very low risk, butall operations after do_pg_start_backup should be protected.
1 parent3ae8e8b commit0282dc2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/replication/basebackup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
101101
datadirpathlen=strlen(DataDir);
102102

103103
startptr=do_pg_start_backup(opt->label,opt->fastcheckpoint,&labelfile);
104-
SendXlogRecPtrResult(startptr);
105104

106105
PG_ENSURE_ERROR_CLEANUP(base_backup_cleanup, (Datum)0);
107106
{
@@ -110,6 +109,8 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
110109
structdirent*de;
111110
tablespaceinfo*ti;
112111

112+
SendXlogRecPtrResult(startptr);
113+
113114
/* Collect information about all tablespaces */
114115
while ((de=ReadDir(tblspcdir,"pg_tblspc"))!=NULL)
115116
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp