Re: sinval synchronization considered harmful

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: sinval synchronization considered harmful
Дата
Msg-id 20110722192803.GA32389@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: sinval synchronization considered harmful  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: sinval synchronization considered harmful
Re: sinval synchronization considered harmful
Список pgsql-hackers
On Thu, Jul 21, 2011 at 11:37:27PM -0400, Robert Haas wrote:
> I think I have a simpler idea, though:
> before acquiring any locks, just have SIGetDataEntries() do this:
> 
> +       if (stateP->nextMsgNum == segP->maxMsgNum && !stateP->resetState)
> +               return 0;
> 
> Patch (with comment explaining why I think this is OK) attached.  If
> the message numbers happen to be equal only because the counter has
> wrapped, then stateP->resetState will be true, so we'll still realize
> we need to do some work.

This is attractive, and I don't see any problems with it.  (In theory, you could
hit a case where the load of resetState gives an ancient "false" just as the
counters wrap to match.  Given that the wrap interval is 1000000x as long as the
reset interval, I'm not worried about problems on actual silicon.)

+1 for doing this and moving on.

-- 
Noah Misch                    http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Policy on pulling in code from other projects?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: sinval synchronization considered harmful