pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Advancing the archiver position safely
3+ messages / 2 participants
[nested] [flat]

* Advancing the archiver position safely
@ 2020-08-07 00:43  Christophe Pettus <xof@thebuild.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Christophe Pettus @ 2020-08-07 00:43 UTC (permalink / raw)
  To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

I've encountered a rather unusual situation (PostgreSQL 9.6).  On a particular server, for reasons I've not fully diagnosed, the archiver thinks that the current WAL segment to be archived is 0000000200003B6800000062.  This is unfortunate, because the oldest WAL segment that actually exists on disk is 0000000200003F1100000004, so the archive script is failing repeatedly because of the missing segment.

The system is not actually missing important (for recovery) WAL segments, at least:

Latest checkpoint's REDO WAL file:    000000020000417600000029

I'd like to "catch up" the archiver such that it is operating on files that actually exist; besides setting archive_command to '/bin/true' and letting it chew through the old ones, is there a way of safely advancing the position of the archiver?
--
-- Christophe Pettus
   xof@thebuild.com






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Advancing the archiver position safely
@ 2020-08-07 01:45  Jerry Sievers <gsievers19@comcast.net>
  parent: Christophe Pettus <xof@thebuild.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Jerry Sievers @ 2020-08-07 01:45 UTC (permalink / raw)
  To: Christophe Pettus <xof@thebuild.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

Christophe Pettus <xof@thebuild.com> writes:

> I've encountered a rather unusual situation (PostgreSQL 9.6).  On a
> particular server, for reasons I've not fully diagnosed, the archiver
> thinks that the current WAL segment to be archived is
> 0000000200003B6800000062.  This is unfortunate, because the oldest WAL
> segment that actually exists on disk is 0000000200003F1100000004, so
> the archive script is failing repeatedly because of the missing
> segment.
>
> The system is not actually missing important (for recovery) WAL segments, at least:
>
> Latest checkpoint's REDO WAL file:    000000020000417600000029
>
> I'd like to "catch up" the archiver such that it is operating on files
> that actually exist; besides setting archive_command to '/bin/true'
> and letting it chew through the old ones, is there a way of safely
> advancing the position of the archiver?

Take a look at the contents of your pg_xlog/archive_status directory
where you will likely find a .ready file corresponding to the missing
segment and perhaps others.

Deleting the .ready file should allow the archiver to get past the
missing file.

Make certain you're *not* mucking with the WAL files themselves.

> --
> -- Christophe Pettus
>    xof@thebuild.com
>
>
>
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Advancing the archiver position safely
@ 2020-08-07 02:00  Christophe Pettus <xof@thebuild.com>
  parent: Jerry Sievers <gsievers19@comcast.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Christophe Pettus @ 2020-08-07 02:00 UTC (permalink / raw)
  To: Jerry Sievers <gsievers19@comcast.net>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>



> On Aug 6, 2020, at 18:45, Jerry Sievers <gsievers19@comcast.net> wrote:
> Deleting the .ready file should allow the archiver to get past the
> missing file.

Ah, excellent, yes.

--
-- Christophe Pettus
   xof@thebuild.com






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-08-07 02:00 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07 00:43 Advancing the archiver position safely Christophe Pettus <xof@thebuild.com>
2020-08-07 01:45 ` Jerry Sievers <gsievers19@comcast.net>
2020-08-07 02:00   ` Christophe Pettus <xof@thebuild.com>

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