| 158 | } |
| 159 | |
| 160 | void redisDbPersistentData::restoreSnapshot(const redisDbPersistentDataSnapshot *psnapshot) |
| 161 | { |
| 162 | serverAssert(psnapshot->m_refCount == 1); |
| 163 | serverAssert(m_spdbSnapshotHOLDER.get() == psnapshot); |
| 164 | |
| 165 | m_pdbSnapshot = psnapshot; // if it was deleted restore it |
| 166 | size_t expectedSize = psnapshot->size(); |
| 167 | dictEmpty(m_pdict, nullptr); |
| 168 | dictEmpty(m_pdictTombstone, nullptr); |
| 169 | endSnapshot(psnapshot); |
| 170 | serverAssert(size() == expectedSize); |
| 171 | } |
| 172 | |
| 173 | // This function is all about minimizing the amount of work done under global lock |
| 174 | // when there has been lots of changes since snapshot creation a naive endSnapshot() |
no test coverage detected