mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-25 00:50:36 +00:00
Previously, the LayerMap was only used as a cache to hold the snapshot layers that were loaded into memory. As a result, we often had to scan the filesystem to get list of all the other snapshot files that exist on disk, but hadn't been loaded into memory yet. That was very slow, consuming huge amounts of CPU and causing timeouts in any non-trivial tests. Refactor so that on startup, we scan the directory once and keep the list of layers in memory.