Re: Why does replication need the old history file?

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why does replication need the old history file?
Date: 2015-06-12 08:18:22
Message-ID: CAB7nPqRrwFnxkuVod+co9nSxxO7tWi2OuxqD4dfs_Natzb3xQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 12, 2015 at 4:56 AM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
> Hackers,
>
> Sequence of events:
>
> 1. PITR backup of server on timeline 2.
>
> 2. Restored the backup to a new server, new-master.
>
> 3. Restored the backup to another new server, new-replica.
>
> 4. Started and promoted new-master (now on Timeline 3).
>
> 5. Started new-replica, connecting over streaming to new-master.
>
> 6. Get error message:
>
> 2015-06-11 12:24:14.503 PDT,,,7465,,5579e05e.1d29,1,,2015-06-11 12:24:14
> PDT,,0,LOG,00000,"fetching timeline history file for timeline 2 from
> primary server",,,,,,,,,""
> 2015-06-11 12:24:14.503 PDT,,,7465,,5579e05e.1d29,2,,2015-06-11 12:24:14
> PDT,,0,FATAL,XX000,"could not receive timeline history file from the
> primary server: ERROR: could not open file
> ""pg_xlog/00000002.history"": No such file or directory
>
> Questions:
>
> A. Why does the replica need 00000002.history? Shouldn't it only need
> 00000003.history?

From where is the base backup taken in case of the node started at 5?

> B. Did something change in this regard in 9.3.6, 9.3.7 or 9.3.8? It was
> working in our previous setup, on 9.3.5, although that could have just
> been that the history file hadn't been removed from the backups yet.

At quick glance, I can see nothing in xlog.c between those releases.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2015-06-12 08:42:09 Re: The purpose of the core team
Previous Message Michael Paquier 2015-06-12 07:29:30 Re: pg_rewind failure by file deletion in source server