Re: Broken --dry-run mode in pg_rewind

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Vladimir Borodin <root(at)simply(dot)name>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Broken --dry-run mode in pg_rewind
Date: 2015-05-08 13:11:06
Message-ID: 20150508131106.GV30322@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Heikki Linnakangas (hlinnaka(at)iki(dot)fi) wrote:
> On 05/08/2015 03:39 PM, Michael Paquier wrote:
> >On Fri, May 8, 2015 at 9:34 PM, Heikki Linnakangas <hlinnaka(at)iki(dot)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.

Wouldn't hurt to also augment that rather doom-looking "point of no
return" comment with a note that says writes won't happen if in
dry-run. :)

For my 2c anyway.

Thanks!

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-05-08 13:21:18 Re: Streaming replication and WAL archive interactions
Previous Message Pavel Stehule 2015-05-08 12:56:39 Re: is possible to upgrade from 9.2 to 9.4 with pg_upgrade