pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Atul Kumar <akumar14871@gmail.com>
Cc: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: strange behavior of WAL files
Date: Fri, 04 Jun 2021 10:11:20 -0400
Message-ID: <144409.1622815880@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+ONtZ77=jQvmumHOsyK9g-ppOV8bBeCzV0AMZk1CBfysCM56g@mail.gmail.com>
References: <CA+ONtZ74cL5Jw54JAWaZY087t4UMGnHXo8WGOZ-D7GK7-zTFbQ@mail.gmail.com>
	<20210604125656.47938b0c@firost>
	<CA+ONtZ77=jQvmumHOsyK9g-ppOV8bBeCzV0AMZk1CBfysCM56g@mail.gmail.com>

Atul Kumar <akumar14871@gmail.com> writes:
> once old WAL files of pg_xlog directory are archived in
> '/nfslogs/wal/' directory then these WAL files are getting generated
> with the same name in pg_xlog directory.

Are you sure you are describing the behavior accurately?

What I would expect to happen, once an old WAL file has been archived
and the server knows its contents are no longer needed, is for the
WAL file to be "recycled" by renaming it to have a name that's in-the-
future in the WAL name series, whereupon it will wait its turn to be
reused by future WAL writes.  On most filesystems the rename as such
doesn't change the file's mod time, so you'll see files that seem
to be in-the-future according to their names, but have old timestamps.

(There's a limit on how many future WAL files we'll tee up this way,
so it's possible that an old one would just get deleted instead.
But the steady-state behavior is to just rotate them around.)

			regards, tom lane





view thread (11+ messages)  latest in thread

Message-ID: <144409.1622815880@sss.pgh.pa.us>
Permalink:  ../144409.1622815880@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/144409.1622815880@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, akumar14871@gmail.com, jgdr@dalibo.com
  Subject: Re: strange behavior of WAL files
  In-Reply-To: <144409.1622815880@sss.pgh.pa.us>
  References: <CA+ONtZ74cL5Jw54JAWaZY087t4UMGnHXo8WGOZ-D7GK7-zTFbQ@mail.gmail.com> <20210604125656.47938b0c@firost> <CA+ONtZ77=jQvmumHOsyK9g-ppOV8bBeCzV0AMZk1CBfysCM56g@mail.gmail.com> <144409.1622815880@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