Re: Question about pg_xlog

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Jerry Sievers *EXTERN*'" <jerry(dot)sievers(at)comcast(dot)net>, M Kiesewetter <mskiesewetter(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Question about pg_xlog
Date: 2017-04-19 08:12:43
Message-ID: A737B7A37273E048B164557ADEF4A58B53A27A92@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Jerry Sievers wrote:
> M Kiesewetter <mskiesewetter(at)gmail(dot)com> writes:
> > I'm new to Postgresql and have a test environment with Postgresql
> > 9.4.5 running on Linux.
> > Today I noticed that the pg_xlog was filled up to 18 Gb.
> > I have:
> > - wal_level=hot_standby
> > - wal_keep_segments = 100
> > - hot_standby = on
> > archive_mode = on
> >
> > It's a test environment en I did a pg_resetxlogs() on the 6th of
> > April.
> > I know that I shouldn't use this, and that it's only a last resort.
> > When I look in de pg_xlog directory I see xlog files that are kept
> > sinds that time.
> > When i look at the archive_status directory I see that all of the
> > files have the suffix of .done.
> > All the other xlogs from the time before the resetlogs are cleaned up
> > as I expected.
> > But I don't understand why the other xlogs aren't recycled.
>
> I'd start by looking for dormant replication slots.
>
> select * from pg_replication_slots;

Don't forget to check pg_prepared_xacts if there are any prepared
transactions that have not been committed or rolled back.

Also, if archive_mode is on, check if archive_command might have
had a non-zero return code. You should find messages in the PostgreSQL log.

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Gone, Sajan 2017-04-19 15:00:27 Postgres replication
Previous Message Albe Laurenz 2017-04-19 07:28:30 Re: List all users with read write access on a PG server with multiple database and objects