Files
neon/pageserver
Vlad Lazar 20788f0732 pageserver: allow read path to plan in-mem layer with concurrent write
Problem

Get page tracing revealed situations where planning an in-memory layer
is taking around 150ms. Upon investigation, the culprit is the inner
in-mem layer file lock. A batch being written holds the write lock
and a read being planned wants the read lock.

Solution

Lift the index out of the RW lock and allow the read path to operate on
an older version of it via ArcSwap. Note that the read IO operation
itself will wait for any on-going writes to finish, but at least we get
to plan concurrently with the write.
2025-05-08 14:22:25 +02:00
..