Add multi threaded UT to trigger cache eviction#811
Add multi threaded UT to trigger cache eviction#811raakella1 wants to merge 4 commits intoeBay:masterfrom
Conversation
885d3d4 to
bd00fd1
Compare
| const auto& hnode = (sisl::SingleEntryHashNode< BtreeNodePtr >&)rec; | ||
| return static_cast< IndexBtreeNode* >(hnode.m_value.get())->m_idx_buf->is_clean(); | ||
| auto idx_buf = static_cast< IndexBtreeNode* >(hnode.m_value.get())->m_idx_buf; | ||
| return !idx_buf || idx_buf->is_clean(); |
There was a problem hiding this comment.
Would you share under which use case idx_buf will be nulllptr?
Shouldn't cache always be the last one to free this buf when evicted?
I think what we need here is probably an debug assert that idx_buf is not nullptr? Or is there a case that I am not aware of?
There was a problem hiding this comment.
The cache is a little different to 1.3. Here, the cache holds a shared ptr to the btree node and the index buffer is a member of the btree node. The idx buffer of a btree node can be freed or copied into a new buffer and the previous idx buffer can become invalid
There was a problem hiding this comment.
Copy to a new buffer is okay as long as it is still valid. When (and who) will free a btree nodes's index buffer with a cache record still pointing to this node?
Would you also help me understand in which case we need to copy a index buffer and invalidate the original idx buff?
571e6f7 to
adb670f
Compare
Add UTs to
Trigger cache eviction in a multi threaded test
Range remove crash recovery