Re: Buffer locking is special (hints, checksums, AIO writes) - Mailing list pgsql-hackers

From Mihail Nikalayeu
Subject Re: Buffer locking is special (hints, checksums, AIO writes)
Date
Msg-id CADzfLwV65qEO1z02Spse47pNP-vGLhaBZpDXfftb2w-28UMf5A@mail.gmail.com
Whole thread Raw
In response to Buffer locking is special (hints, checksums, AIO writes)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hello, Andres!

Andres Freund <andres@anarazel.de>:
>
>    As part of that introduce a new lock level in-between share and exclusive
>    locks (provisionally called share-exclusive, but I hate it). The new lock
>    level allows other share lockers, but can only be held by one backend.
>
>    This allows to change the rules so that:
>
>    1) Share lockers are not allowed to modify buffers anymore
>    2) Hint bits need the new lock mode (conditionally upgrading the lock in SetHintBits())
>    3) Write IO needs to the new lock level

IIUC, it may be mapped to existing locking system:

BUFFER_LOCK_SHARE          ---->      AccessShareLock
new lock mode                           ---->     ExclusiveLock
BUFFER_LOCK_EXCLUSIVE   ---->     AccessExclusiveLock

So, it all may be named:

BUFFER_LOCK_ACCESS_SHARE
BUFFER_LOCK_EXCLUSIVE
BUFFER_LOCK_ACCESS_EXCLUSIVE

being more consistent with table-level locking system.

Greetings,
Mikhail.



pgsql-hackers by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Transparent column encryption
Next
From: Dilip Kumar
Date:
Subject: Re: Potential problem in commit f777d773878 and 4f7f7b03758