pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Richard Huxton <dev@archonet.com>
Cc: pgsql-docs@postgresql.org
Subject: Re: Proposed doc-patch: Identifying the Current WAL file
Date: Fri, 14 Apr 2006 12:07:15 -0400
Message-ID: <9932.1145030835@sss.pgh.pa.us> (raw)
In-Reply-To: <200604141544.k3EFiuw20847@candle.pha.pa.us>
References: <200604141544.k3EFiuw20847@candle.pha.pa.us>

Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Richard Huxton wrote:
>> To identify the current, partially-filled WAL segment, sort first by
>> mtime and second by file name. That is, take the latest mtime among the
>> properly-named files, breaking ties by taking the higher filename.

> I am confused by this.  Why do both mtime and file name need to be
> checked?

Because recycled WAL segments are renamed to have higher file names than
the currently-in-use segment.  So you can't depend on file name first.
However, shortly after a segment switch two WAL segments could have the
same mtime (to within whatever the mtime granularity is, typ. 1 second).

The proposed rule should be OK as long as checkpoints (and ensuing
renames) can't occur oftener than the mtime granularity.  If you're
checkpointing more than once a second, well, you need help ...

			regards, tom lane



view thread (27+ messages)  latest in thread

Message-ID: <9932.1145030835@sss.pgh.pa.us>
Permalink:  ../9932.1145030835@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9932.1145030835@sss.pgh.pa.us

 · 

reply

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-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, dev@archonet.com
  Subject: Re: Proposed doc-patch: Identifying the Current WAL file
  In-Reply-To: <9932.1145030835@sss.pgh.pa.us>

* 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