Large objects buffer leak
От | |
---|---|
Тема | Large objects buffer leak |
Дата | |
Msg-id | Pine.LNX.3.96.980716164416.17513A-100000@Chimay обсуждение исходный текст |
Ответ на | Re: Need your comments/help (The Hermit Hacker <scrappy@hub.org>) |
Список | pgsql-hackers |
Hi. I wrote some time ago about a buffer leak appearing with PostgreSQL large objects, calling for hints about where to look. As I did not get any answer, I dived a little bit more in the code. The problem is simple. For performance reasons (as far as I can tell), PG large objects keep the object internal scan index open as long as the object is not closed. The problem is that this index (may) keep pinned buffers. In the CommitTransaction() function, these buffers are examined and released if necessary, with an error notice. For long objects this causes a segmentation fault in postmaster (and this is present in current public release). Whenever all large objects operations are done inside a transaction (begin - open lo - ... - close lo - end), this problem does not appear (CommitTransaction() is only called on the END statement, when the index is closed). In order to correct this, I see two solutions: - close the index after every operation on large objects - clean up large objects opened indexes in CommitTransaction() I prefer the second one, that offers speed-up inside transactions. But as I do not know all the evolutions in progress, I would like to know which should be used in order to be coherent with the current works. Yet another question, does someone work on large objects ? If not, I can code this bug fix and submit a patch. Thanks. --- Pascal ANDRE, graduated from Ecole Centrale Paris andre@via.ecp.fr "Use the source, Luke. Be one with the Code." -- Linus Torvalds
В списке pgsql-hackers по дате отправления: