Re: XLogInsert scaling, revisited

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: XLogInsert scaling, revisited
Дата
Msg-id 20130717122459.GC12343@alap2.anarazel.de
обсуждение исходный текст
Ответ на Re: XLogInsert scaling, revisited  (Amit Kapila <amit.kapila@huawei.com>)
Ответы Re: XLogInsert scaling, revisited  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
On 2013-07-17 15:46:00 +0530, Amit Kapila wrote:
> On Monday, July 08, 2013 2:47 PM Heikki Linnakangas wrote:  
> > Ok, I've committed this patch now. Finally, phew!
> 
> Few doubts while reading the code:
> 
> 1. Why in function WALInsertSlotAcquireOne(int slotno), it does
> START_CRIT_SECTION() to
>    Lock out cancel/die interrupts, whereas other places call
> HOLD_INTERRUPTS()

A crit section does more than just stopping interrupts. They also ensure
that errors that occur while inside one get converted to a PANIC. That
seems apt for SlotAcquire/Release. Although the comments could possibly
improved a bit.

> 2. In function GetXLogBuffer(), why the logic to wakeup waiters is
> different when expectedEndPtr != endptr;
>   When the wakeupwaiters is done in case expectedEndPtr == endptr?

I am not sure what you're asking here. We wakeup waiters if
expectedEndPtr != endptr because that means the wal buffer page the
'ptr' fits on currently has different content. Which in turn means we've
finished with the last page and progressed to a new one. So we wake up
everyone waiting for us.
WakeupWaiters() doesn't get passed expectedEndPtr but expectedEndPtr -
XLOG_BLCKSZ (up to there we are guaranteed to have inserted
successfully). And we're comparing with the xlogInsertingAt value which
basically measures up to where we've successfully inserted.

> 3.
> static bool
> ReserveXLogSwitch(..)
> 
> In above function header, why EndPos_p/StartPos_p is used when
> function arguments are EndPos/StartPos?

I guess that's bitrot...

Greetings,

Andres Freund

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



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

Предыдущее
От: Gurjeet Singh
Дата:
Сообщение: Re: review: Non-recursive processing of AND/OR lists
Следующее
От: Ants Aasma
Дата:
Сообщение: Re: Improvement of checkpoint IO scheduler for stable transaction responses