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 
: max_size(std::max(static_cast<size_t>(1), max_size_)) {}
    MappedPtr get(const Key & key)
    {
        std::lock_guard lock(mutex);
        auto res = getImpl(key, lock);
        if (res)
            ++hits;
        else
            ++misses;
        return res;
    }
    void set(const Key & key, const MappedPtr & mapped)
    {
        std::lock_guard lock(mutex);
        setImpl(key, mapped, lock);
    }
    
    
    
    
    
    
    
    
    template <typename LoadFunc>
    std::pair<MappedPtr, bool> getOrSet(const Key & key, LoadFunc && load_func)