Re: BUG #14999: pg_rewind corrupts control file global/pg_control - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #14999: pg_rewind corrupts control file global/pg_control
Date
Msg-id 20180227012441.GB3255@paquier.xyz
Whole thread Raw
In response to Re: BUG #14999: pg_rewind corrupts control file global/pg_control  (TipTop Labs <office@tiptop-labs.com>)
Responses Re: BUG #14999: pg_rewind corrupts control file global/pg_control
List pgsql-bugs
On Mon, Feb 26, 2018 at 05:28:53PM +0100, TipTop Labs wrote:
> 1. I can confirm that your patch is effective also in my Docker-based
> test setup and with the current REL_10_STABLE code base
> (i.e. PostgreSQL 10.2).

Thanks for checking.  Note that I am still not completely happy with the
handling in errno in some newly-added code paths..

> 2. Your patch is more encompassing than the one I had submitted
> earlier, and it may be the right way to go. It is cleaner but more
> "complicated" in that it may require enlisting/recognizing all those
> special files (pg_control, filenode.map, etc). IMO the earlier patch
> would already/tolerate handle those, because the distinction it makes
> is not based on whether something is a configuration file, but purely
> on whether it is writable.

You are basically looking for that I think:
https://www.postgresql.org/message-id/20180205071022.GA17337%40paquier.xyz
You cannot ignore pg_control and filenode.map though as those are
critical data so they have to be updated.  So if those files are not
writable, you actually have more problems than you think as the cluster
would not be able to correctly start.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: "Kolla, Mahesh"
Date:
Subject: RE: BUG #15078: Unable to receive data from WAL Stream Error
Next
From: Michael Paquier
Date:
Subject: Re: BUG #15092: pg_basebackup directory checking