Re: BUG #14999: pg_rewind corrupts control file global/pg_control
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: TipTop Labs <office@tiptop-labs.com>
Cc: Michael Paquier <michael.paquier@gmail.com>, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Date: 2018-02-27T01:24:41Z
Lists: pgsql-bugs, pgsql-hackers
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
Commits
-
Add note in pg_rewind documentation about read-only files
- 378f78da8628 9.5.14 landed
- 741ad15f3b83 9.6.10 landed
- 423039779165 10.5 landed
- 0e4a46670e3a 11.0 landed
- eb270b00b2d6 12.0 landed