Re: Reducing ClogControlLock contention

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reducing ClogControlLock contention
Date: 2015-09-19 03:32:23
Message-ID: CAA4eK1+fD8v9YvqZnMkEvWggdRceRVdDyERN0GQ7Y==928pA-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 18, 2015 at 11:31 PM, Jesper Pedersen <
jesper(dot)pedersen(at)redhat(dot)com> wrote:

> On 08/31/2015 07:34 AM, Amit Kapila wrote:
>
>> I have updated the patch (attached with mail) to show
>> you what I have in mind.
>>
>>
> I havn't been able to get a successful run with _v5 using pgbench.
>
>
This patch is still not ready for performance test, as you might
have seen in comments that we are still discussing locking
issues.

> TransactionIdSetStatusBit assumes an exclusive lock on CLogControlLock
> when called, but that part is removed from TransactionIdSetPageStatus now.
>

It doesn't seem to be a necessary condition, thats why in this patch
a smaller granularity lock is introduced.

> I tried an
>
> if (!LWLockHeldByMe(CLogControlLock))
> {
> LWLockAcquire(CLogControlLock, LW_EXCLUSIVE);
> mode = LW_EXCLUSIVE;
> }
>
> approach, but didn't get further.

I suspect the problem is something else.

> Plus that probably isn't the best way, since we will traverse all LWLock's,

Yes, but it does in such a way that probably the caller will find it in
very few initial entries in the array.

Thank you very much for doing valuable performance tests with the
CLog patches.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2015-09-19 04:29:18 Re: [patch] Proposal for \rotate in psql
Previous Message Amit Kapila 2015-09-19 03:11:44 Re: Speed up Clog Access by increasing CLOG buffers