mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
7c84b8e524
* chore: change how we track memory_budget during evictions We compared memory_budget vs 0 before inserting a new item in DbSlice, and retired cool pages if we are low on memory. The problem - when we decide whether we allow growing a table, we estimate the possible object size increase due to the future table growth. And the memory check described before was not consistent with the actual logic that rejected the insertion. Moreover, the memory_budget tracking interaction with EvictionPolicy was over-complicated: we passed the memory_budget counter to the evp object and then read it back, even though evp did not track object deletions memory impact during objects evictions. Now, we remove the responsibility from evp to update memory_budget_ so it's solely updated by DbSlice. We also update memory_budget_ during deletions, and when we pass it to evp, we add cool memory size as potential memory resource to avoid rejections in case we have lots of cool memory. Fixes #3456 --------- Signed-off-by: Roman Gershman <roman@dragonflydb.io> |
||
---|---|---|
.. | ||
actions | ||
images | ||
ISSUE_TEMPLATE | ||
workflows | ||
PULL_REQUEST_TEMPLATE.md |