Skip to content

Commit cf9069f

Browse files
pbhandar2meta-codesync[bot]
authored andcommitted
Fix duplicate REMOVE event in remove(AccessIterator)
Summary: remove(AccessIterator&) records a REMOVE/REMOVED event before calling removeImpl(), but passes the default recordApiEvent=true to removeImpl(), which records the same REMOVE event again. This results in duplicate REMOVE events for a single remove-by-iterator operation. Fix by passing recordApiEvent=false to removeImpl() since the event is already recorded by the caller. Reviewed By: rlyerly Differential Revision: D100876318 fbshipit-source-id: 632ac377f87ad5d75843a5b70b5fbb35615ae0a7
1 parent 0a81319 commit cf9069f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cachelib/allocator/CacheAllocator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4247,7 +4247,8 @@ CacheAllocator<CacheTrait>::remove(AccessIterator& it) {
42474247
HashedKey hk{it->getKey()};
42484248
auto tombstone =
42494249
nvmCache_ ? nvmCache_->createDeleteTombStone(hk) : DeleteTombStoneGuard{};
4250-
return removeImpl(hk, *it, std::move(tombstone));
4250+
return removeImpl(hk, *it, std::move(tombstone), true /* removeFromNvm */,
4251+
false /* recordApiEvent */);
42514252
}
42524253

42534254
template <typename CacheTrait>

0 commit comments

Comments
 (0)