Re: Use pg_rewind when target timeline was switched

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use pg_rewind when target timeline was switched
Date: 2015-07-22 07:28:35
Message-ID: CAPpHfds5-qhAsEuiSK4OBPv_NVDkNfjQbo4oeKfGw7Nbab+HTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 22, 2015 at 8:48 AM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> On Mon, Jul 20, 2015 at 9:18 PM, Alexander Korotkov
> <a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> > attached patch allows pg_rewind to work when target timeline was
> switched.
> > Actually, this patch fixes TODO from pg_rewind comments.
> >
> > /*
> > * Trace the history backwards, until we hit the target timeline.
> > *
> > * TODO: This assumes that there are no timeline switches on the target
> > * cluster after the fork.
> > */
> >
> > This patch allows pg_rewind to handle data directory synchronization is
> much
> > more general way. For instance, user can return promoted standby to old
> > master.
>
> Yes. That would be useful.
>
> > In this patch target timeline history is exposed as global variable.
> Index
> > in target timeline history is used in function interfaces instead of
> > specifying TLI directly. Thus, SimpleXLogPageRead() can easily start
> reading
> > XLOGs from next timeline when current timeline ends.
>
> The implementation looks rather neat by having a first look at it, but
> the attached patch fails to compile:
> pg_rewind.c:488:4: error: use of undeclared identifier 'targetEntry'
> targetEntry = &targetHistory[i];
> ^
> Nice to see as well that this has been added to the CF of September.
>

Uh, sorry. Fixed version is attached.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
pg-rewind-target-switch-2.patch application/octet-stream 16.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kouhei Kaigai 2015-07-22 07:44:30 Re: fdw_scan_tlist for foreign table scans breaks EPQ testing, doesn't it?
Previous Message Kyotaro HORIGUCHI 2015-07-22 07:10:17 Re: Asynchronous execution on FDW