Files
neon/libs/utils
Heikki Linnakangas b6b8265450 Rewrite to make the algorithm more understandable (I hope).
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.
2023-03-28 01:28:27 +03:00
..