Re: pg_rewind exiting with error code 1 when source and target are on the same timeline

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: pg_rewind exiting with error code 1 when source and target are on the same timeline
Date: 2015-12-12 11:08:30
Message-ID: CAB7nPqTMqNUQAHKGamYgv1C9iFk5nXORBJ6sY6gobVG=SS3n7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Dec 12, 2015 at 11:13 AM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> On 12/3/15 11:10 PM, Michael Paquier wrote:
>> On Fri, Dec 4, 2015 at 12:22 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>>> On 10/22/15 1:42 AM, Michael Paquier wrote:
>>>> I am not sure that I am not getting completely your point, why would
>>>> it be a win to remove this safety check? We surely do not want to look
>>>> for the common ancestor timeline if the target and source nodes have
>>>> the same timeline, so we should not remove this check and just set
>>>> rewind_needed to false to fallback to the same exit(0) for all those
>>>> code paths. Per se the attached for example.
>>>
>>> After playing with this a bit, I think your patch is correct. The code
>>> has drifted a bit in the meantime, so attached is an updated patch.
>>
>> Thanks for looking at it.
>
> I committed this to master. It's also on the 9.5 open item list, but if
> I backport it then the tests don't pass. Still looking. Not sure yet
> if this is because of code changes in pg_rewind master or test
> infrastructure changes in master.

The failure is as follows:
source data directory must be shut down cleanly
Failure, exiting
not ok 1 - pg_rewind local

And is caused by the fact that master checks that the source node has
been stopped with DB_SHUTDOWNED and not DB_SHUTDOWNED_IN_RECOVERY. On
master we allow both. This has been discussed here as well previously:
http://www.postgresql.org/message-id/55FA2537.4070600@gmx.net

Attached is a patch for 9.5, the test case also needs to have a call
to RewindTest::clean_rewind_test().
Regards,
--
Michael

Attachment Content-Type Size
20151212_pgrewind_same_timeline_95.patch binary/octet-stream 4.2 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jhonatan Martinez 2015-12-12 13:01:45 Error postgres9.5
Previous Message Peter Eisentraut 2015-12-12 02:13:35 Re: pg_rewind exiting with error code 1 when source and target are on the same timeline