Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Alexander Korotkov <a.korotkov@postgrespro.ru>
From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: konstantin knizhnik <k.knizhnik@postgrespro.ru>
Cc: Andres Freund <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-06-05T10:09:08Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow page lock to conflict among parallel group members.
- 3ba59ccc896e 13.0 landed
-
Allow relation extension lock to conflict among parallel group members.
- 85f6b49c2c53 13.0 landed
-
Add assert to ensure that page locks don't participate in deadlock cycle.
- 72e78d831ab5 13.0 landed
-
Assert that we don't acquire a heavyweight lock on another object after
- 15ef6ff4b985 13.0 landed
-
Fix unsafe usage of strerror(errno) within ereport().
- 81256cd05f07 11.0 cited
On Tue, Jun 5, 2018 at 12:48 PM Konstantin Knizhnik <k.knizhnik@postgrespro.ru> wrote: > Workload is combination of inserts and selects. > Looks like shared locks obtained by select cause starvation of inserts, trying to get exclusive relation extension lock. > The problem is fixed by fair lwlock patch, implemented by Alexander Korotkov. This patch prevents granting of shared lock if wait queue is not empty. > May be we should use this patch or find some other way to prevent starvation of writers on relation extension locks for such workloads. Fair lwlock patch really fixed starvation of exclusive lwlock waiters. But that starvation happens not on relation extension lock – selects don't get shared relation extension lock. The real issue there was not relation extension lock itself, but the time spent inside this lock. It appears that buffer replacement happening inside relation extension lock is affected by starvation on exclusive buffer mapping lwlocks and buffer content lwlocks, caused by many concurrent shared lockers. So, fair lwlock patch have no direct influence to relation extension lock, which is naturally not even lwlock... I'll post fair lwlock path in a separate thread. It requires detailed consideration and benchmarking, because there is a risk of regression on specific workloads. ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company