pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
OK to delete old .history files from archive?
2+ messages / 2 participants
[nested] [flat]

* OK to delete old .history files from archive?
@ 2020-07-03 18:02 Don Seiler <don@seiler.us>
  2020-07-10 20:05 ` Re: OK to delete old .history files from archive? David Steele <david@pgmasters.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Don Seiler @ 2020-07-03 18:02 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

TL;DR: Is it OK to delete .history files from WAL archive (wal-g/S3) that
are older than the oldest full backup?

Today we had restores fail complaining that they can't find timeline 21
when they should only be on timeline 1. The logs show them recovering 12+
.history files from the WAL archives. Looking at the archives, these
history files are all timestamped between last July and October. The
restore is from a full backup taken last night.

This happens to be the first restore after adding
"recovery_target_timeline='latest'" to our recovery.conf template. So I'm
guessing that PG just didn't bother with those old .history files before.

I believe these old .history files were just not properly cleaned up from
some exercises done last year on previous/other incarnations and are now
just polluting the WAL archive. I don't see why I would need .history files
that are nearly a year older than the backup I'm restoring from, but just
want to confirm it is safe to blow them all away.

Thanks,
Don.

-- 
Don Seiler
www.seiler.us

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: OK to delete old .history files from archive?
  2020-07-03 18:02 OK to delete old .history files from archive? Don Seiler <don@seiler.us>
@ 2020-07-10 20:05 ` David Steele <david@pgmasters.net>
  0 siblings, 0 replies; 2+ messages in thread

From: David Steele @ 2020-07-10 20:05 UTC (permalink / raw)
  To: Don Seiler <don@seiler.us>; Pgsql-admin <pgsql-admin@lists.postgresql.org>

Hi Don,

On 7/3/20 2:02 PM, Don Seiler wrote:
> TL;DR: Is it OK to delete .history files from WAL archiveĀ (wal-g/S3) 
> that are older than the oldest full backup?
> 
> Today we had restores fail complaining that they can't find timelineĀ 21 
> when they should only be on timeline 1. The logs show them recovering 
> 12+ .history files from the WAL archives. Looking at the archives, these 
> history files are all timestamped between last July and October. The 
> restore is from a full backup taken last night.
> 
> This happens to be the first restore after adding 
> "recovery_target_timeline='latest'" to our recovery.conf template. So 
> I'm guessing that PG just didn't bother with those old .history files 
> before.
> 
> I believe these old .history files were just not properly cleaned up 
> from some exercises done last year on previous/other incarnations and 
> are now just polluting the WAL archive. I don't see why I would need 
> .history files that are nearly a year older than the backup I'm 
> restoring from, but just want to confirm it is safe to blow them all away.

It should be fine to remove the history files as they do not refer to 
any valid history in the WAL.

Of course, it would be best to keep a copy of them until you test your 
restore again. Just in case.

Regards,
-- 
-David
david@pgmasters.net






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-07-10 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03 18:02 OK to delete old .history files from archive? Don Seiler <don@seiler.us>
2020-07-10 20:05 ` David Steele <david@pgmasters.net>

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