From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Farina <daniel@fdr.io>
Cc: pgsql-general@postgresql.org
Subject: Re: Extra files in "base" dir not seen in relfilenodes
Date: Tue, 16 Jan 2018 18:18:23 -0500
Message-ID: <1664.1516144703@sss.pgh.pa.us> (raw)
In-Reply-To: <CACN56+Pb+XH_8iu=jcmAk4QcuGwahHY7geft14jaAZk6T-48oA@mail.gmail.com>
References: <CACN56+N6XNATLAzQiQk0N2E6HehGgkNi+dyTgNBv+uGnoLUXiw@mail.gmail.com>
<794.1516143838@sss.pgh.pa.us>
<CACN56+Pb+XH_8iu=jcmAk4QcuGwahHY7geft14jaAZk6T-48oA@mail.gmail.com>
Daniel Farina <daniel@fdr.io> writes:
> On Tue, Jan 16, 2018 at 3:04 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Umm ... are you accounting for catalogs that have zeroes in
>> pg_class.relfilenode? It's generally better to rely on the
>> pg_relation_filenode(oid) function than the raw column contents.
> Yeah, the catalogs are not considered here (oids < 10000). The oids in
> question are rather high. Let me re-run the antijoin with the function
> though....
> Indeed, same result.
Hmm, you should have gotten a result that was different by the size
of the bootstrap catalogs (pg_class, pg_attribute, pg_proc, pg_type,
plus their indexes). I'm worried that you're going to accidentally
delete those critical catalogs.
However, assuming you've gotten that detail right, then any file
you can't match up with a relfilenode value must be an orphan you
can just "rm".
Do you have any theories about how the DB got like this? Were there
system crashes or anything like that recently? Is there any pattern
to the file access or mod dates on the putatively-orphaned files?
regards, tom lane
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, daniel@fdr.io
Subject: Re: Extra files in "base" dir not seen in relfilenodes
In-Reply-To: <1664.1516144703@sss.pgh.pa.us>
References: <CACN56+N6XNATLAzQiQk0N2E6HehGgkNi+dyTgNBv+uGnoLUXiw@mail.gmail.com> <794.1516143838@sss.pgh.pa.us> <CACN56+Pb+XH_8iu=jcmAk4QcuGwahHY7geft14jaAZk6T-48oA@mail.gmail.com> <1664.1516144703@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