Re: [HACKERS] handling multiple file descriptors

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marc Tardif <admin(at)wtbwts(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] handling multiple file descriptors
Date: 2000-02-19 07:29:07
Message-ID: 11896.950945347@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marc Tardif <admin(at)wtbwts(dot)com> writes:
> I've been trying to figure out how postgresql handles multiple open file
> descriptors. First, I have managed to find out postgresql keeps a pool of
> available descriptors for general processing tasks like sorting for
> example. Second, I have tried to find what kind of data structure was used
> for open descriptors to tables and indices, but couldn't find where. Could
> someone please let me know what kind of data structure(s) is/are used for
> open file descriptors and where this is located in the code?

See src/backend/storage/file/fd.c. You might also find buffile.c,
in the same directory, of interest.

These modules are not simply concerned with managing kernel FDs, but
also with releasing resources during transaction abort. Postgres'
model of error recovery is that elog(ERROR) longjmps back to the main
server loop, so routines that were aborted out of don't get to close
files, free memory, or otherwise release resources. fd.c is responsible
for cleaning up open FDs and temporary files after that happens.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2000-02-19 08:34:11 gram.y foreign keys
Previous Message Tatsuo Ishii 2000-02-19 05:14:02 new backslah command of psql