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

Commit3979ff1

Browse files
committed
Don't crash when pg_xlog is empty and pg_basebackup -x is used
The backup will not work (without a logarchive, and that's the wholepoint of -x) in this case, this patch just changes it to throw anerror instead of crashing when this happens.Noticed and diagnosed by TAKATSUKA Haruka
1 parentbd5ab4b commit3979ff1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/backend/replication/basebackup.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
297297
}
298298
qsort(walFiles,nWalFiles,sizeof(char*),compareWalFileNames);
299299

300+
/*
301+
* There must be at least one xlog file in the pg_xlog directory,
302+
* since we are doing backup-including-xlog.
303+
*/
304+
if (nWalFiles<1)
305+
ereport(ERROR,
306+
(errmsg("could not find any WAL files")));
307+
300308
/*
301309
* Sanity check: the first and last segment should cover startptr and
302310
* endptr, with no gaps in between.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp