Re: [HACKERS] Broken order-of-operations in parallel query latch manipulation

2016-08-02 Thread Amit Kapila
On Mon, Aug 1, 2016 at 8:45 PM, Tom Lane wrote: > Amit Kapila writes: >> On Mon, Aug 1, 2016 at 1:58 AM, Tom Lane wrote: >>> I believe this is wrong and the CHECK_FOR_INTERRUPTS needs to be before >>> or after the two latch operations. As-is, if the reason somebody set >>> our latch was to get

Re: [HACKERS] Broken order-of-operations in parallel query latch manipulation

2016-08-01 Thread Tom Lane
Amit Kapila writes: > On Mon, Aug 1, 2016 at 1:58 AM, Tom Lane wrote: >> I believe this is wrong and the CHECK_FOR_INTERRUPTS needs to be before >> or after the two latch operations. As-is, if the reason somebody set >> our latch was to get us to notice that a CHECK_FOR_INTERRUPTS condition >> h

Re: [HACKERS] Broken order-of-operations in parallel query latch manipulation

2016-07-31 Thread Amit Kapila
On Mon, Aug 1, 2016 at 1:58 AM, Tom Lane wrote: > Both shm_mq.c and nodeGather.c contain instances of this coding pattern: > > WaitLatch(MyLatch, WL_LATCH_SET, 0); > CHECK_FOR_INTERRUPTS(); > ResetLatch(MyLatch); > > I believe this is wrong and the CHECK_FOR_INT