W46: According to history file, WAL location belongs to timeline N

Category: WAL & Checkpoint Events
SQLSTATE: n/a
Urgency: medium

Example Postgres Log Output:

FATAL: according to history file, WAL location 2D5/22000000 belongs to timeline 3, but previous recovered WAL file came from timeline 4

Explanation:

This error is caused by a "phantom" WAL segment being present on two timelines.

See the Learn More section for details on how exactly such a situation can happen.

The server will not be able to continue recovery whilst the problematic WAL segment is present.

Recommended Action:

In general, ensure you are using an up-to-date Postgres version, as the known cause for this problem is a very specific bug in Postgres that is fixed in all current patch releases.

If you are already in this situation, you can remove the offending WAL segment in order for Postgres to continue recovery, or simply make a new follower from a new base backup.

Learn More:


Download Free eBook: The Top 6 Postgres Log Events
Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →