Re: BUG #14999: pg_rewind corrupts control file global/pg_control
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: TipTop Labs <office@tiptop-labs.com>, Michael Paquier <michael.paquier@gmail.com>, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Date: 2018-03-05T07:54:31Z
Lists: pgsql-bugs, pgsql-hackers
Attachments
- 0001-Improve-error-handling-of-configuration-files-in-pg_.patch (text/x-diff) patch 0001
On Fri, Mar 02, 2018 at 04:35:07PM +0100, Dmitry Dolgov wrote: > It maybe a stupid question, but why do you need to reset errno here? Is it to > avoid its value being carried from previous calls of `open_target_file`? In > this case if you put the code with `errno == EACCESS` under the if condition > `if (dstfd < 0)`, then as far as I remember you should always get relevant > errno. At the same time maybe it's valid to reset `errno` before `open`, like > with `getpriority`: [ ... reads and feels stupid ...] Of course all the checks should be where dstno is negative... I have done a second pass on the patch, and attached is a new version. This fixes this handling of errno and addresses some typos. I have also fixed the test case where one of the read-only files was not properly switched to do so. I have also added a commit log message. -- 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