Re: pg_rewind in contrib - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: pg_rewind in contrib
Date
Msg-id 5501EC77.9070901@iki.fi
Whole thread Raw
In response to Re: pg_rewind in contrib  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: pg_rewind in contrib  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On 03/12/2015 08:49 AM, Amit Kapila wrote:
> With attached modified script, I am able to reproduce the
> error (I have used the latest pg_rewind patch (pg_rewind-bin-8))

Thanks! That reproduced the error for me too. Not sure why I couldn't
reproduce it earlier.

The cause was a silly typo in truncate_target_file:

> @@ -397,7 +397,7 @@ truncate_target_file(const char *path, off_t newsize)
>
>         snprintf(dstpath, sizeof(dstpath), "%s/%s", datadir_target, path);
>
> -       fd = open(path, O_WRONLY, 0);
> +       fd = open(dstpath, O_WRONLY, 0);
>         if (fd < 0)
>                 pg_fatal("could not open file \"%s\" for truncation: %s\n",
>                                  dstpath, strerror(errno));

Attached is a new version of the patch, including that fix, and rebased
over current git master.

- Heikki


Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: get_object_address support for additional object types
Next
From: Peter Eisentraut
Date:
Subject: Re: logical column ordering