Skip to content

Commit d2cbd5b

Browse files
igchorbyrnedj
authored andcommitted
Fix moving for slab release
1 parent 9283cc8 commit d2cbd5b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cachelib/allocator/CacheAllocator-inl.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,6 @@ void CacheAllocator<CacheTrait>::moveRegularItemWithSync(
12661266
// ??? util::LatencyTracker tracker{stats_.evictRegularLatency_};
12671267

12681268
XDCHECK_EQ(newItemHdl->getSize(), oldItem.getSize());
1269-
XDCHECK_NE(getTierId(oldItem), getTierId(*newItemHdl));
12701269

12711270
// take care of the flags before we expose the item to be accessed. this
12721271
// will ensure that when another thread removes the item from RAM, we issue
@@ -3083,9 +3082,14 @@ bool CacheAllocator<CacheTrait>::tryMovingForSlabRelease(
30833082
? moveChainedItem(oldItem.asChainedItem(), newItemHdl)
30843083
: moveRegularItem(oldItem, newItemHdl);
30853084
} else {
3086-
// TODO: add support for chained items
3087-
moveRegularItemWithSync(oldItem, newItemHdl);
3088-
return true;
3085+
if (oldItem.isChainedItem() || oldItem.hasChainedItem()) {
3086+
// TODO: add support for chained items
3087+
return false;
3088+
} else {
3089+
moveRegularItemWithSync(oldItem, newItemHdl);
3090+
removeFromMMContainer(oldItem);
3091+
return true;
3092+
}
30893093
}
30903094
}
30913095

0 commit comments

Comments
 (0)