Skip site navigation (1) Skip section navigation (2)

Re: Deleted WAL files held open by backends in Linux

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Deleted WAL files held open by backends in Linux
Date: 2009-12-01 15:12:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> Is there a reasonably cheap way to check whether the backend has a
> WAL file open and whether that one is the current append target?

Detecting whether we have a WAL file open is trivial (just look at
the static variable holding the file descriptor).  Determining whether
it's still the current append target is not so cheap though; it would
require examining shared-memory status which means taking a lock on
that status (and it's a high-traffic lock already).

We could have the open WAL file dropped if stale as a side-effect
anytime we have occasion to examine that shared state anyway.  But
in a nearly-read-only session such as your example I'm not sure that
would happen often enough to fix the problem.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2009-12-01 15:15:36
Subject: Re: Block-level CRC checks
Previous:From: Robert HaasDate: 2009-12-01 15:09:49
Subject: Re: [PATCH] Windows x64

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group