| 3098 | } |
| 3099 | |
| 3100 | bool redisDbPersistentData::removeCachedValue(const char *key, dictEntry **ppde) |
| 3101 | { |
| 3102 | serverAssert(m_spstorage != nullptr); |
| 3103 | // First ensure its not a pending key |
| 3104 | if (m_spstorage != nullptr) |
| 3105 | m_spstorage->batch_lock(); |
| 3106 | |
| 3107 | dictEntry *de = dictFind(m_dictChanged, key); |
| 3108 | if (de != nullptr) |
| 3109 | { |
| 3110 | if (m_spstorage != nullptr) |
| 3111 | m_spstorage->batch_unlock(); |
| 3112 | return false; // can't evict |
| 3113 | } |
| 3114 | |
| 3115 | // since we write ASAP the database already has a valid copy so safe to delete |
| 3116 | if (ppde != nullptr) { |
| 3117 | *ppde = dictUnlink(m_pdict, key); |
| 3118 | } else { |
| 3119 | dictDelete(m_pdict, key); |
| 3120 | } |
| 3121 | |
| 3122 | if (m_spstorage != nullptr) |
| 3123 | m_spstorage->batch_unlock(); |
| 3124 | |
| 3125 | return true; |
| 3126 | } |
| 3127 | |
| 3128 | redisDbPersistentData::redisDbPersistentData() { |
| 3129 | m_dictChanged = dictCreate(&dictChangeDescType, nullptr); |
no test coverage detected