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

@ -738,6 +738,9 @@ void EngineShard::CacheStats() {
}
}
DCHECK_EQ(table_memory, db_slice.table_memory());
if (tiered_storage_) {
table_memory += tiered_storage_->CoolMemoryUsage();
}
size_t obj_memory = table_memory <= used_mem ? used_mem - table_memory : 0;
size_t bytes_per_obj = entries > 0 ? obj_memory / entries : 0;