Re: issue with gininsert under very high load - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: issue with gininsert under very high load
Date
Msg-id 52FCFCF6.2030900@dunslane.net
Whole thread Raw
In response to Re: issue with gininsert under very high load  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On 02/13/2014 10:58 AM, Heikki Linnakangas wrote:

>>> Perhaps we should use a lock to enforce that only one process tries to
>>> clean up the pending list at a time.
>>
>> Is that going to serialize all these inserts?
>
> It will serialize the cleanup process, which moves entries from the 
> pending list to the tree proper. But that's better than the current 
> situation. Currently, when two processes attempt it, they will both 
> try to insert into the GIN tree, but one of them will notice that the 
> other one already did the cleanup, and bail out. So only one process 
> contributes to progress, while the others just waste their effort.
>
> The processes should try to get the lock, and just give up if it's 
> already held rather than wait. If someone else is already doing the 
> cleanup, there's no need for the current process to do it.
>


Sounds good.

cheers

andrew




pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: nextVictimBuffer in README
Next
From: Andres Freund
Date:
Subject: Re: truncating pg_multixact/members