Don't choke on files that are removed while pg_rewind runs.

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: b36805f3c54fe0e50e58bb9e6dad66daca46fbf6
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2015-06-28T18:35:51Z
Releases: 9.5.0
Don't choke on files that are removed while pg_rewind runs.

If a file is removed from the source server, while pg_rewind is running, the
invocation of pg_read_binary_file() will fail. Use the just-added missing_ok
option to that function, to have it return NULL instead, and handle that
gracefully. And similarly for pg_ls_dir and pg_stat_file.

Reported by Fujii Masao, fix by Michael Paquier.

Files

PathChange+/−
src/bin/pg_rewind/libpq_fetch.c modified +30 −7