From: Greg Smith <greg@2ndQuadrant.com>
To: Rob Cowell <Rob.Cowell@transversal.com>
Cc: 'pgsql-admin@postgresql.org' <pgsql-admin@postgresql.org>
Subject: Re: replication recovery/startup question
Date: Tue, 03 Jul 2012 12:40:06 -0400
Message-ID: <4FF32066.5070000@2ndQuadrant.com> (raw)
In-Reply-To: <1SjBRT-0000RM-TA@eq1.mail.transversal.net>
References: <1SjBRT-0000RM-TA@eq1.mail.transversal.net>
On 06/25/2012 11:40 AM, Rob Cowell wrote:
> Why would the output from ‘ls’ show older filenames (0....1....3D...xx)
> as newer in date than the “0....1....3F...xx” filenames?
>
> Does Postgres re-cycle old log filenames ?
It recycles old log files. If you turn on log_checkpoints, you can see
how many and how often. It will list a count of recycled WAL files at
each checkpoint, along with how many of the old ones were just deleted
instead.
The weird pattern in the timestamps you're seeing is a state in the
middle of doing that, and yes they look quite weird sometimes. The
files are noteed as reusable, get re-initialized to hold new data
(they're not overwritten completely with zeros like new WAL files are),
and renamed to a new segment number. And each of those steps has a
corresponding flush to disk step which makes sure the filesystem
metadata is updated. Some of the middle states there are unusual.
> Does the output from ‘ps’ mean the master/slave are in sync, or is the
> slave really still playing catchup (based on the names of the logfiles
> in pg_xlog) ?
Your example was in sync, with the file names just being odd due to the
implementation of WAL file recycling. You might also check
pg_stat_replication to get an easier view of things, rather than relying
on ps. ps is correct, it's just harder to check.
--
Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: greg@2ndQuadrant.com, Rob.Cowell@transversal.com
Subject: Re: replication recovery/startup question
In-Reply-To: <4FF32066.5070000@2ndQuadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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