Re: dsm_unpin_segment

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: dsm_unpin_segment
Дата
Msg-id 28596.1470704024@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: dsm_unpin_segment  (Thomas Munro <thomas.munro@enterprisedb.com>)
Ответы Re: dsm_unpin_segment  (Thomas Munro <thomas.munro@enterprisedb.com>)
Re: dsm_unpin_segment  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> Yeah, I was considering unbalanced pin/unpin requests to be a
> programming error.  To be more defensive about that, how about I add a
> boolean 'pinned' to dsm_control_item, and elog(ERROR, ...) if it's not
> in the expected state when you try to pin or unpin?

Well, what you have there is a one-bit-wide pin request counter.
I do not see why that's better than an actual counter, but if that's
what you want to do, fine.

The larger picture here is that Robert is exhibiting a touching but
unfounded faith that extensions using this feature will contain zero bugs.
IMO there needs to be some positive defense against mistakes in using the
pin/unpin API.  As things stand, multiple pin requests don't have any
fatal consequences (especially not on non-Windows), so I have little
confidence that it's not happening in the field.  I have even less
confidence that there wouldn't be too many unpin requests.  What exactly
is an extension going to be doing to ensure that it doesn't do too many of
one or the other?
        regards, tom lane



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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: dsm_unpin_segment
Следующее
От: "Tsunakawa, Takayuki"
Дата:
Сообщение: Re: Wait events monitoring future development