pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: postgresql history and timelines
Date: Sun, 18 Nov 2018 15:38:02 +0200
Message-ID: <60ed06d9-6e04-f8a4-afbc-c607a2d3aa35@matrix.gatewaynet.com> (raw)
In-Reply-To: <CA+t6e1k+akLVuXUGdw0rCM-W9BttNSOcg+Ytt=weric_FSs3sA@mail.gmail.com>
References: <CA+t6e1k+akLVuXUGdw0rCM-W9BttNSOcg+Ytt=weric_FSs3sA@mail.gmail.com>


On 18/11/18 11:29 π.μ., Mariel Cherkassky wrote:
> Hi guys,
> Wanted to understand something that isnt clear to me, please correct 
> me if I'm wrong :
>
> -When we want to recover our database or promote a secondary to be a 
> master a new time line will be created. A new file will be created in 
> the pg_xlog directory named '00000TIMELINEID.history'.
> -During the daily work, the primary or the secondary shouldnt have a 
> .history file right ?
> -The history file contains only the timeline id and the location to 
> start from the timeline.
> -When using repmgr, after cloning the primary and starting the 
> secondary the secondary should replay wals from :
> 1.archives
> 2.local wals
> 3.Streaming replication from primary
> ?


Streaming and if not available from the archives. Careful with the 
archives. Local wals are a result of receiving them via restore, they 
are not a source to replay from.


>
> I cloned the primary to the secondary, and when I tried to start the 
> secondary I got the next message :
>  LOG:  restored log file "000000010000090A00000002" from archive
> FATAL:  requested timeline 2 is not a child of this server's history
>  DETAIL:  Latest checkpoint is at xx on timeline 1, but in the history 
> of the requested timeline, the server forked off from that timeline at YY.
>

Cloning must be done withing a start / stop backup or done with 
pg_basebackup.

After the cloning, you must first create recovery.conf, set it up 
correctly and then start the standby, pg_basebackup does this for you.

What the message says to you is that smth messed up with the timelines, 
wrong/old backup, garbage files in pg_xlog, etc.


> So I didnt recover my primary or promoted a secondary so how is it 
> possible that I have a file from timeline 2 ? Are there other 
> operations that creates a new timeline ?
>

Can you describe the precise sequence of steps that you took?


>
> Thanks.




view thread (2+ messages)

Message-ID: <60ed06d9-6e04-f8a4-afbc-c607a2d3aa35@matrix.gatewaynet.com>
Permalink:  ../60ed06d9-6e04-f8a4-afbc-c607a2d3aa35@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/60ed06d9-6e04-f8a4-afbc-c607a2d3aa35@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: achill@matrix.gatewaynet.com
  Subject: Re: postgresql history and timelines
  In-Reply-To: <60ed06d9-6e04-f8a4-afbc-c607a2d3aa35@matrix.gatewaynet.com>
  References: <CA+t6e1k+akLVuXUGdw0rCM-W9BttNSOcg+Ytt=weric_FSs3sA@mail.gmail.com> <60ed06d9-6e04-f8a4-afbc-c607a2d3aa35@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox