separating use of SerialSLRULock

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
Subject: separating use of SerialSLRULock
Date: 2024-01-29 13:13:21
Message-ID: 202401291313.qqxzgfnmex7t@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

In Dilip's patch to improve SLRU concurrency, there's a requirement to
prevent predicate.c's SLRU control lock from being used to control
access to another shared memory structure, SerialControlData. This
struct is used to keep track of the areas of the SLRU that are valid.
Dilip just embedded that change into the patch he submitted, but I think
the patch is actually wrong in detail, because it's leaving the
SerialAdd() function unchanged to use SerialSLRULock, which is wrong
because that function depends heavily on the contents of
SerialControlData, and it also modifies it. So if run concurrently with
the other functions that are using SerialControlLock, the result would
make no sense.

I came up with the attached. If there are no objections, I'll be
pushing this shortly.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"The Gord often wonders why people threaten never to come back after they've
been told never to return" (www.actsofgord.com)

Attachment Content-Type Size
v1-0001-Split-use-of-SerialSLRULock.patch text/x-diff 6.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2024-01-29 13:17:28 RE: Synchronizing slots from primary to standby
Previous Message torikoshia 2024-01-29 13:02:29 Re: RFC: Logging plan of the running query