mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-14 19:50:38 +00:00
The algorithm is the same (with two small exceptions), but rewrite the way it's implemented to make it easier to follow. The exceptions: 1. 'min_resident_size' now protects at least that much data in the first "respectful" phase of the algorithm. Previously, it would evict layers until the resident size fell below min_resident_size. In other words, we know protect one more layer of each tenant, so that the resident size stays just above min_resident_size, while previously we would evict enough to bring the resident size just under min_resident_size. 2. Previously, the "max layer size" that's used as the default min_resident_size was calculated from *all* layers in the tenant, including remote layers. Now it's only calculated across all locally-present layers. I don't know if that was a deliberate choice, but this is slightly simpler.