pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: manojkumar@ameyo.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16739: Temporary files not deleting from data folder on disk
Date: Mon, 23 Nov 2020 10:33:21 -0500
Message-ID: <57259.1606145601@sss.pgh.pa.us> (raw)
In-Reply-To: <16739-01bbd1b6e3a30313@postgresql.org>
References: <16739-01bbd1b6e3a30313@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> There is a problem with Postgres that temporary tables being created are not
> cleaning up by Postgres itself.

Can you produce any actual evidence of that, or even better a reproduction
sequence?

> Count of temporary files-
> select count(*) from pg_ls_dir ( '/var/lib/pgsql/10/data/base/16384' ) as
> file where file::text not in (select oid::text from pg_class );

This is not evidence, because the test is completely incorrect.

* OID is not the pg_class field to use.  relfilenode is closer,
although that will still mislead you for certain system catalogs.
pg_relation_filenode(oid) is really the recommended way to get the
base file name for a pg_class entry.

* Even once you've got the right filename, it's only the *base* file
name.  There might be additional segments (nnn.1, nnn.2, etc) if any
table exceeds 1GB.  There are likely to also be "nnn_fsm" and
"nnn_vm" subsidiary files, and maybe "nnn_init" files.  All of those
would have to be excluded before concluding that files are being
leaked.

See

https://www.postgresql.org/docs/current/storage.html

for more info about what you should expect to see in a database
directory.

			regards, tom lane





view thread (12+ messages)  latest in thread

Message-ID: <57259.1606145601@sss.pgh.pa.us>
Permalink:  ../57259.1606145601@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/57259.1606145601@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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, manojkumar@ameyo.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16739: Temporary files not deleting from data folder on disk
  In-Reply-To: <57259.1606145601@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