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

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't choke on files that are removed while pg_rewind runs.
Date: 2015-06-28 18:39:21
Message-ID: E1Z9HU9-0005Rv-Og@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b36805f3c54fe0e50e58bb9e6dad66daca46fbf6

Modified Files
--------------
src/bin/pg_rewind/libpq_fetch.c | 37 ++++++++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-06-28 19:17:55 pgsql: Fix double-XLogBeginInsert call in GIN page splits.
Previous Message Kevin Grittner 2015-06-28 17:48:02 pgsql: Fix comment for GetCurrentIntegerTimestamp().