Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
7.0.0-Beta1
-
Triaged
-
1
-
Yes
-
KV-Engine 2021-Jan
Description
There is a bug which, if triggered, will stop a bucket from successfully evicting ever again (until restart/bucket deletion).
Bug introduced in http://review.couchbase.org/c/kv_engine/+/133197 (6.6.1 pre-GA).
item_pager.cc,ItemPager::run |
|
112
|
if (((current > upper) || doEvict || wasNotified) &&
|
113
|
(*available).compare_exchange_strong(inverse, false)) {
|
114
|
if (kvBucket->getItemEvictionPolicy() == EvictionPolicy::Value) {
|
115
|
doEvict = true;
|
116
|
}
|
117
|
|
118
|
++stats.pagerRuns;
|
119
|
|
120
|
if (current <= lower) {
|
121
|
// early exit - no need to run a paging visitor
|
122
|
return true;
|
123
|
}
|
The above change introduced the highlighted early exit; in the event that the item pager is notified to run, but the memory usage has dropped below the low watermark, don't evict. However, this is not safe to do -
item_pager.cc,ItemPager::run |
|
112
|
if (((current > upper) || doEvict || wasNotified) &&
|
113
|
(*available).compare_exchange_strong(inverse, false)) {
|
Available is an atomic bool used to track if an item pager is currently running. It has been set to false here, but is only reset once the created PagingVisitor is completed. If the visitor creation is skipped, the flag is never reset, so no further item pager runs will occur.
Attachments
Issue Links
- is caused by
-
MB-40531 HiFi MRU Item Pager evicts active items when 2-bit LRU does not
- Closed