https://github.com/ClickHouse/ClickHouse/blob/055a6563d756e3535774fdd1cee5b83d7b798801/src/Common/LRUCache.h#L283

If `insert` throws exception (bad_alloc or similar), the Cell will be in incorrect state.

Found by @nvartolomei 
{
        size_t current_weight_lost = 0;
        size_t queue_size = cells.size();
        while ((current_size > max_size) && (queue_size > 1))
        {
            const Key & key = queue.front();
            auto it = cells.find(key);
            if (it == cells.end())
            {
                LOG_ERROR(&Poco::Logger::get("LRUCache"), "LRUCache became inconsistent. There must be a bug in it.");
                abort();
            }
            const auto & cell = it->second;
            current_size -= cell.size;
            current_weight_lost += cell.size;
            cells.erase(it);
            queue.pop_front();
            --queue_size;
        }
        onRemoveOverflowWeightLoss(current_weight_lost);
        if (current_size > (1ull << 63))
        {
            LOG_ERROR(&Poco::Logger::get("LRUCache"), "LRUCache became inconsistent. There must be a bug in it.");
            abort();
        }
    }
    
    virtual void onRemoveOverflowWeightLoss(size_t ) {}