On 12/15/2016 10:44 AM, Magnus Hagander wrote:
I wonder if there might be more corner cases like this, but in this
particular one it seems easy enough to just say that failing to rename
recovery.conf because it didn't exist is safe.


Yeah. It's unexpected though, so I think erroring out is quite reasonable. If the recovery.conf file went missing, who knows what else is wrong.

But in the case of failing to rename recovery.conf for example because of
permissions errors, we don't want to ignore it. But we also really don't
want to end up with this kind of inconsistent data directory IMO. I don't
know that code well enough to suggest how to fix it though -- hoping for
input for someone who knows it closer?

Hmm. Perhaps we should write the timeline history file only after renaming recovery.conf. In general, we should keep the window between writing the timeline history file and writing the end-of-recovery record as small as possible. I don't think we can eliminate it completely, but it makes sense to minimize it. Something like the attached (completely untested).

- Heikki

Attachment: reorder-end-of-archive-recovery-actions-1.patch
Description: invalid/octet-stream

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to