Make parallel nbtree index scans use an LWLock.
authorPeter Geoghegan
Sat, 8 Mar 2025 16:10:14 +0000 (11:10 -0500)
committerPeter Geoghegan
Sat, 8 Mar 2025 16:10:14 +0000 (11:10 -0500)
commit67fc4c9fd7fab7004b656e0cc27826c75d7ea7ad
tree2e0555a4b537036caa392a64aa079c5552334204
parent8021c77769e90cc804121d61a1bb7bcc4652d48b
Make parallel nbtree index scans use an LWLock.

Teach parallel nbtree index scans to use an LWLock (not a spinlock) to
protect the scan's shared descriptor state.

Preparation for an upcoming patch that will add skip scan optimizations
to nbtree.  That patch will create the need to occasionally allocate
memory while the scan descriptor is locked, while copying datums that
were serialized by another backend.

Author: Peter Geoghegan 
Reviewed-By: Matthias van de Meent
Discussion: https://postgr.es/m/CAH2-Wz=PKR6rB7qbx+Vnd7eqeB5VTcrW=iJvAsTsKbdG+kW_UA@mail.gmail.com
src/backend/access/nbtree/nbtpreprocesskeys.c
src/backend/access/nbtree/nbtree.c
src/backend/storage/lmgr/lwlock.c
src/backend/utils/activity/wait_event_names.txt
src/include/storage/lwlock.h