Re: [HACKERS] handling multiple file descriptors

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] handling multiple file descriptors
Дата
Msg-id 11896.950945347@sss.pgh.pa.us
обсуждение исходный текст
Ответ на handling multiple file descriptors  (Marc Tardif <admin@wtbwts.com>)
Список pgsql-hackers
Marc Tardif <admin@wtbwts.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marc Tardif
Дата:
Сообщение: handling multiple file descriptors
Следующее
От: Thomas Lockhart
Дата:
Сообщение: gram.y foreign keys