Skip to content

Conversation

@bitfaster
Copy link
Owner

@bitfaster bitfaster commented Jul 18, 2023

Fix unbounded LRU growth when keys are requested in order. Added better parameterized tests to detect this.

I had introduced a bug in the cycle/tryremovecold method: when warm queue is full the last cold item should be discarded immediately.

When cache size is below 1000, element count is now constrained to capacity +1 (we allow warm queue to be capacity+1, enabling items to re-enter warm). When cache size is above 1000, element count is constrained to at worst capacity + 5. Experimentally, this matches the number of cycle attempts (which is currently 5). This is a bug that results in at most a 0.5% capacity overage, so much better than prior to the fix.

@coveralls
Copy link

coveralls commented Aug 15, 2023

Coverage Status

coverage: 96.335% (-0.1%) from 96.45% when pulling 6a62462 on users/alexpeck/unbounded into 7484d33 on main.

Alex Peck added 2 commits August 15, 2023 16:52
@bitfaster
Copy link
Owner Author

Verified hit rate analysis is approx the same (difference is noise), except for ARC OLTP which is around 1% better hit rate across the board.

@bitfaster bitfaster marked this pull request as ready for review August 17, 2023 00:26
@bitfaster bitfaster merged commit f55bacb into main Aug 17, 2023
@bitfaster bitfaster deleted the users/alexpeck/unbounded branch August 17, 2023 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Cold queue increases infinitely for some partitions and cache sizes

3 participants