1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00
dragonflydb-dragonfly/.github
Roman Gershman 7c84b8e524
chore: change how we track memory_budget during evictions (#3457)
* 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>
2024-08-07 15:43:45 +03:00
..
actions fix: missing logs on ci timeout (#3452) 2024-08-06 14:52:18 +03:00
images update readme (#794) 2023-02-14 23:08:32 +02:00
ISSUE_TEMPLATE feat(server): support epoll linux api (#351) 2022-10-04 11:11:09 +03:00
workflows chore: change how we track memory_budget during evictions (#3457) 2024-08-07 15:43:45 +03:00
PULL_REQUEST_TEMPLATE.md docs(PR Template): Add PR Template Enforcing Conventional Commits #107 (#137) 2022-06-12 10:40:17 +03:00