Content-Length: 269058 | pFad | http://github.com/postgrespro/postgres/commit/db4ef737606e340479d68f63f33bc7d21f937ca7

EF Don't crash when pg_xlog is empty and pg_basebackup -x is used · postgrespro/postgres@db4ef73 · GitHub
Skip to content

Commit db4ef73

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 whole point of -x) in this case, this patch just changes it to throw an error instead of crashing when this happens. Noticed and diagnosed by TAKATSUKA Haruka
1 parent fcf9eca commit db4ef73

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
@@ -303,6 +303,14 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
303303
}
304304
qsort(walFiles, nWalFiles, sizeof(char *), compareWalFileNames);
305305

306+
/*
307+
* There must be at least one xlog file in the pg_xlog directory,
308+
* since we are doing backup-including-xlog.
309+
*/
310+
if (nWalFiles < 1)
311+
ereport(ERROR,
312+
(errmsg("could not find any WAL files")));
313+
306314
/*
307315
* Sanity check: the first and last segment should cover startptr and
308316
* endptr, with no gaps in between.

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/db4ef737606e340479d68f63f33bc7d21f937ca7

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy