row_cache: Evict partition snapshots
If snapshots are not evicted, they may pin unbouned amount of memory for a long time in cache, which may lead to OOM. Evict snapshots together with the entry. Fixes #2775. Fixes #2730.
This commit is contained in:
@@ -854,7 +854,7 @@ future<> row_cache::update_invalidating(external_updater eu, memtable& m) {
|
||||
// This invalidates all row ranges and the static row, leaving only the partition tombstone continuous,
|
||||
// which has to always be continuous.
|
||||
cache_entry& e = *cache_i;
|
||||
e.partition() = partition_entry(mutation_partition::make_incomplete(*e.schema(), mem_e.partition().partition_tombstone()));
|
||||
e.partition().evict(); // FIXME: evict gradually
|
||||
} else {
|
||||
_tracker.clear_continuity(*cache_i);
|
||||
}
|
||||
@@ -966,6 +966,10 @@ cache_entry::cache_entry(cache_entry&& o) noexcept
|
||||
}
|
||||
}
|
||||
|
||||
cache_entry::~cache_entry() {
|
||||
_pe.evict();
|
||||
}
|
||||
|
||||
void row_cache::set_schema(schema_ptr new_schema) noexcept {
|
||||
_schema = std::move(new_schema);
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@ public:
|
||||
}
|
||||
|
||||
cache_entry(cache_entry&&) noexcept;
|
||||
~cache_entry();
|
||||
|
||||
bool is_evictable() { return _lru_link.is_linked(); }
|
||||
const dht::decorated_key& key() const { return _key; }
|
||||
|
||||
Reference in New Issue
Block a user