Re: [HACKERS] Patch to log usage of temporary files

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bill Moran <wmoran(at)collaborativefusion(dot)com>, pgsql-hackers(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Patch to log usage of temporary files
Date: 2007-01-09 22:16:49
Message-ID: 200701092216.l09MGnP20739@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > + A value of zero logs all temporary files, and positive
> > + values log only files whose size is equal or greater than
> > + the specified number of bytes.
>
> Surely the measurement unit should be kbytes or disk blocks. And why
> aren't you using that GUC UNITS infrastructure Peter put in?

Agreed. I have applied the following patch to make it kilobytes, and
documented it. I didn't put '-1kB' in the postgresql.conf file because
the -1 value is special. (ideas?)

> > /* reset flag so that die() interrupt won't cause problems */
> > vfdP->fdstate &= ~FD_TEMPORARY;
> > + PG_TRACE1(temp__file__cleanup, vfdP->fileName);
> > + if (log_temp_files >= 0)
> > + {
> > + if (stat(vfdP->fileName, &filestats) == 0)
>
> The TRACE is in the wrong place no? I thought it was going to be after
> the stat() operation so it could pass the file size.
>
> Also, I dunno much about DTrace, but I had the idea that you can't
> simply throw a PG_TRACE macro into the source and think you are done
> --- isn't there a file of probe declarations to add to? Not to mention
> the documentation of what probes exist.

I didn't like the macro in that area anyway. It seems too adhock to
just throw it in when we have so few places monitored now. Removed.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 3.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-01-09 22:20:00 Re: [HACKERS] SGML index build fix
Previous Message Bruce Momjian 2007-01-09 22:01:05 Re: Last infomask bit

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2007-01-09 22:20:00 Re: [HACKERS] SGML index build fix
Previous Message Bruce Momjian 2007-01-09 22:01:05 Re: Last infomask bit