Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock(PG10.7)

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: chenhj <chjischj(at)163(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock(PG10.7)
Date: 2019-09-29 14:38:08
Message-ID: CAPpHfduQdEVcZrJhceU01zfa5dYrw8oc5f1m8NNGSYM8VFS3GA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

Thank you for reporting.

On Sun, Sep 29, 2019 at 11:17 AM chenhj <chjischj(at)163(dot)com> wrote:
> Does the locking order of autovacuum process(root->right->left) correct? While insert process lock gin buffer by order of bottom->top and left->right.
>
> 1. vacuum(root->right->left):

Starting from root seems OK for me, because vacuum blocks all
concurrent inserts before doing this. But this needs to be properly
documented in readme.

Locking from right to left is clearly wrong. It could deadlock with
concurrent ginStepRight(), which locks from left to right. I expect
this happened in your case. I'm going to reproduce this and fix.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2019-09-29 15:12:31 Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock(PG10.7)
Previous Message Alexander Korotkov 2019-09-29 14:29:56 Re: pgsql: Implement jsonpath .datetime() method