pg_rewind failure by file deletion in source server - Mailing list pgsql-hackers

From Fujii Masao
Subject pg_rewind failure by file deletion in source server
Date
Msg-id CAHGQGwEdsNgeNZo+GyrzZtjW_TkC=XC6XxrjuAZ7=X_cj1aHHg@mail.gmail.com
Whole thread Raw
Responses Re: pg_rewind failure by file deletion in source server  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Hi,

While testing pg_rewind, I got the following error and pg_rewind failed.
   $ pg_rewind -D ... --source-server="..." -P   ERROR:  could not open file "base/13243/16384" for reading: No
such file or directory   STATEMENT:  SELECT path, begin,         pg_read_binary_file(path, begin, len) AS chunk
FROMfetchchunks
 

As far as I read the pg_rewind code, ISTM that the file deletion in
source server while pg_rewind is running can cause pg_rewind to fail.
That is, at first pg_rewind picks up the files to copy (or do some actions)
and creates the file map. Then it performs the actual operation (e.g.,
file copy from source to dest) according to the file map. The problem
can happen if the source server deletes the file listed in the file map
before pg_rewind performs the actual operations. The copy of the file
must fail because it's not found in source server, and then pg_rewind
exits with an error.

Shouldn't pg_rewind ignore that failure of operation? If the file is not
found in source server, the file doesn't need to be copied to destination
server obviously. So ISTM that pg_rewind safely can skip copying that file.
Thought?

Regards,

-- 
Fujii Masao



pgsql-hackers by date:

Previous
From: Rosiński Krzysztof 2 - Detal
Date:
Subject: Re: [idea] table partition + hash join
Next
From: Jeff Janes
Date:
Subject: Re: skipping pg_log in basebackup (was Re: pg_basebackup and pg_stat_tmp directory)