You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/12 05:42:46 UTC

[GitHub] merlimat opened a new pull request #2785: Refresh ZK cache based on insertion time rather than access

merlimat opened a new pull request #2785: Refresh ZK cache based on insertion time rather than access
URL: https://github.com/apache/pulsar/pull/2785
 
 
   ### Motivation
   
   The ZK cache in Pulsar broker is currently doing the invalidations based on ZK watches to trigger refreshing of the cached values.
   
   If for some reason the ZK watch is not triggered (and we've seen few such cases), then the broker will operate on a stale value. The cache eviction is also based on access time, so if some value is not being requested for 1h it will be dropped from cache.
   
   The problem that can rise is that: 
    1. The zk watch is missed
    2. A (stale) cache value keeps getting accessed (eg. clients trying to reconnect and failing for ACLs)
    3. The stale value will be kept in cache indefinitely
   
   ### Modifications
   
    * Based the cache expire on the time when an item is inserted into the cache
    * Use 5 min expire time to limit the worst case of staleness for config
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services