Re: PostgreSQL WAL file issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gokhan Demir <demirgokhan(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: PostgreSQL WAL file issue
Date: 2017-11-09 14:59:39
Message-ID: 8333.1510239579@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Gokhan Demir <demirgokhan(at)gmail(dot)com> writes:
> The issue I believe on PostgreSQL server is that server is creating WAL
> files whose names already exists on previous dates. The question I want to
> ask is: How is this possible and what can be do to fix it?

I don't know anything about barman, but the state of your server's pg_xlog
directory looks perfectly normal to me. The active WAL file is evidently
000000010000000C0000007C, and the files before it have been successfully
archived, as indicated by the matching archive_status/*.done files.
There are also 17 "future" WAL files, 7D through 8D, waiting to be used.
(17 seems a bit high given that your consumption rate is only a couple
per day; I'd consider backing down the relevant configuration setting.
But it's not totally unreasonable.)

What's bugging you, I gather, is that the "future" WAL files have
timestamps older than any of the past or current ones. That's normal
in a server that's been up for awhile, because "future" files are made
by renaming old ones that are no longer needed. The alternative is to
drop them and fill new ones, which would just create extra disk traffic,
so we don't.

Archiving solutions should always pay attention to the existence of
archive_status files, not to the apparent file modification dates.
I'm sure barman gets that right, so I don't know what's causing
your actual problem.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message rammohan ganapavarapu 2017-11-09 16:22:37 Re: Can master and slave on different PG versions?
Previous Message Marcelo Kruger 2017-11-09 12:06:30 Re: High replication lag - Stream Replication