Details
-
Task
-
Resolution: Unresolved
-
Major
-
None
-
None
-
1
Description
PagingVisitor, used by ItemPager and ExpiredItemPager to visit all stored values stored in the hashtable of each vbucket, may expire items found with an expiry time in the past.
To do so outside of hashtable locks, the visitor accumulates expired items in a list:
bool PagingVisitor::visit(const HashTable::HashBucketLock& lh, StoredValue& v) {
|
...
|
if (isExpired) {
|
std::unique_ptr<Item> it = v.toItem(currentBucket->getId());
|
expired.push_back(*it.get());
|
return true;
|
}
|
The items in this list are actually expired after the vbucket visit is done:
void PagingVisitor::update() {
|
store.deleteExpiredItems(expired, ExpireBy::Pager);
|
However, with an expiry heavy workload, and a sizeable cluster, there could be a very large number of items collected in this list.
Investigate whether this becomes an actual issue in real-world scenarios, and assess whether the size of this list should be capped. If found to be necessary, the accumulated items can then be expired when the limit is reached (ensuring that this still occurs outside of any hashtable locks) and the list emptied.