Use pg_rewind when target timeline was switched - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Use pg_rewind when target timeline was switched
Date
Msg-id CAPpHfdtaqYGz6JKvx4AdySA_ceqPH7Lki=F1HxUeNNaBRC7Mtw@mail.gmail.com
Whole thread Raw
Responses Re: Use pg_rewind when target timeline was switched
List pgsql-hackers
Hackers,

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.

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.

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

pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: TABLESAMPLE patch is really in pretty sad shape
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] pg_upgrade fails when postgres/template1 isn't in default tablespace