Re: Pinning a buffer in TupleTableSlot is unnecessary
От | Andres Freund |
---|---|
Тема | Re: Pinning a buffer in TupleTableSlot is unnecessary |
Дата | |
Msg-id | 20161114181729.i5wxe3trlf4cjnkz@alap3.anarazel.de обсуждение исходный текст |
Ответ на | Re: Pinning a buffer in TupleTableSlot is unnecessary (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Pinning a buffer in TupleTableSlot is unnecessary
|
Список | pgsql-hackers |
On 2016-11-14 13:12:28 -0500, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > > On 2016-11-14 12:32:53 -0500, Tom Lane wrote: > >> Basically my concern is that this restriction isn't documented anywhere > >> and I'm not entirely certain it's been adhered to everywhere. I'd feel > >> much better about it if there were some way we could verify that. > > > Would support for valgrind complaining about access to unpinned buffers > > suffice? > > I don't think it directly addresses the issue, but certainly it'd help. Well, it detects situations where removed pins cause "unprotected access", but of course that doesn't protect against cases where independent pins hide that issue. > Do you think that's easily doable? I think so, yes. IIRC I discussed it with Noah and Peter G. at a conference recently. We'd basically mark the content of shared buffers inaccessible at backend startup, and mark it accessible whenever a PinBuffer() happens, and then inaccessible during unpinning. We probably have to exclude the page header though, as we intentionally access them unpinned in some cases IIRC. - Andres
В списке pgsql-hackers по дате отправления: