Re: XLogInsert scaling, revisited

Amit Kapila <amit.kapila@huawei.com>

From: Amit Kapila <amit.kapila@huawei.com>
To: "'Heikki Linnakangas'" <hlinnakangas@vmware.com>, "'Andres Freund'" <andres@2ndquadrant.com>
Cc: "'Jeff Janes'" <jeff.janes@gmail.com>, "'Alvaro Herrera'" <alvherre@2ndquadrant.com>, "'PostgreSQL-development'" <pgsql-hackers@postgresql.org>
Date: 2013-07-17T10:16:00Z
Lists: pgsql-hackers
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()

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

3.
static bool
ReserveXLogSwitch(..)

In above function header, why EndPos_p/StartPos_p is used when
function arguments are EndPos/StartPos?


With Regards,
Amit Kapila.