chore: tiered fixes (#3393)

1. Use introsive::list for CoolQueue.
2. Make sure that we ignore cool memory usage when computing average object size to
   prevent evictions during dashtable growth attempts.
3. Remove items from the cool storage before evicting them from the dash table.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-07-25 23:38:44 +03:00 committed by GitHub
parent 2867d54a05
commit 0a26a06065
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 131 additions and 194 deletions

View file

@ -57,6 +57,7 @@ struct SliceEvents {
// ram hit/miss when tiering is enabled
size_t ram_hits = 0;
size_t ram_cool_hits = 0;
size_t ram_misses = 0;
// how many insertions were rejected due to OOM.
@ -444,9 +445,9 @@ class DbSlice {
// Evicts items with dynamically allocated data from the primary table.
// Does not shrink tables.
// Returnes number of bytes freed due to evictions.
size_t FreeMemWithEvictionStep(DbIndex db_indx, size_t starting_segment_id,
size_t increase_goal_bytes);
// Returnes number of (elements,bytes) freed due to evictions.
std::pair<uint64_t, size_t> FreeMemWithEvictionStep(DbIndex db_indx, size_t starting_segment_id,
size_t increase_goal_bytes);
void ScheduleForOffloadStep(DbIndex db_indx, size_t increase_goal_bytes);
int32_t GetNextSegmentForEviction(int32_t segment_id, DbIndex db_ind) const;