bee
bee copied to clipboard
evict just enough chunks of a batch to fall below the reserve capacity
To minimize chunks loss, we should only evict enough chunks fall below the capacity. This can be done by passing a "max evict counter" calculated in the unreserve function and passed to the evict batch function.
The other required change is that the collected items should be sorted by binID first so that the older chunks are evicted first.
Also, we can temporarily disable caching of evicted chunks until a performant and stable solution is found: see https://github.com/ethersphere/bee/issues/4530