Re: Broken --dry-run mode in pg_rewind - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Broken --dry-run mode in pg_rewind
Date
Msg-id 554CB229.4000207@iki.fi
Whole thread Raw
In response to Re: Broken --dry-run mode in pg_rewind  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Broken --dry-run mode in pg_rewind
List pgsql-hackers
On 05/08/2015 03:39 PM, Michael Paquier wrote:
> On Fri, May 8, 2015 at 9:34 PM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>> On 05/08/2015 03:25 PM, Vladimir Borodin wrote:
>>> Seems, that pg_rewind does not account --dry-run option properly. A simple
>>> fix
>>> for that is attached.
>>
>>
>> No, the --dry-run takes effect later. It performs all the actions it
>> normally would, including reading files from the source, except for actually
>> writing anything in the target. See the dry-run checks in file_ops.c
>
> Even if the patch sent is incorrect, shouldn't there be some process
> bypass in updateControlFile() and createBackupLabel() in case of a
> --dry-run?

They both use open_target_file() and write_target_file(), which check 
for --dry-run and do nothing if it's set.

Hmm, I wonder it we should print something else than "Done!" at the end, 
if run in --dry-run mode. Or give some indication around the time it 
says "Rewinding from last common checkpoint at ...", that it's running 
in dry-run mode and won't actually modify anything. The progress 
messages are a bit alarming if you don't realize that it's skipping all 
the writes.

- Heikki




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Broken --dry-run mode in pg_rewind
Next
From: Pavel Stehule
Date:
Subject: Re: is possible to upgrade from 9.2 to 9.4 with pg_upgrade