I'm making some progress on PIP-430 Broker cache i...
# dev
l
I'm making some progress on PIP-430 Broker cache improvements. I'll be submitting a PR soon with the changes. There's some unit test coverage that I have on my TODO list before that. I have the current pending changes in my fork PR https://github.com/lhotari/pulsar/pull/213 . One interesting detail was that I re-read S3FIFO cache eviction paper and explanation blog post and added that to the PIP-413 document as influence for the design. I hope that it helps others to understand why a FIFO queue is used.
S3FIFO Cache Eviction Algorithm Influence
This FIFO queue-based solution is influenced by the S3FIFO cache eviction algorithm (algorithm explanation), although it is not an implementation of S3FIFO. It accomplishes a similar goal as S3FIFO, but for the managed ledger broker cache. The goal of S3FIFO is to quickly remove entries that are unlikely to be accessed in the future. Similarly, the PIP-430 broker cache removal queue aims to quickly and efficiently remove entries that would be unlikely to be accessed in the future. The reason why S3FIFO is not implemented in broker cache is that in broker caching, the "expected read count" concept is used to determine whether an entry is likely to be accessed in the future. This information is not available in generic cache implementations, and in the broker cache this information can be used to keep entries in the cache longer that are likely to be accessed in the future.
The S3FIFO algorithm explanation blog post states: "While the eviction algorithms so far have been centered around LRU, I believe modern eviction algorithms should be designed with FIFO queues." This is one of the reasons why the PIP-430 broker cache removal queue is also based on a FIFO queue.
The removal queue implementation is already part of master branch since PR https://github.com/apache/pulsar/pull/24363 contained the first part of PIP-430 implementation.
👍 1
I submitted the PIP-430 Broker cache improvements PR now: https://github.com/apache/pulsar/pull/24623 . I'll add more details later about the changes. I'd appreciate early reviews based on the current content.