mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-17 02:12:56 +00:00
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.