← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1438564] Re: Glance cache sqlite driver prunes newly cached images first over older images

 

** Changed in: glance
       Status: Fix Committed => Fix Released

** Changed in: glance
    Milestone: None => kilo-rc1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1438564

Title:
  Glance cache sqlite driver prunes newly cached images first over older
  images

Status in OpenStack Image Registry and Delivery Service (Glance):
  Fix Released

Bug description:
  Glance cache uses  LRU strategy for cache pruning. It does so by
  keeping track of the last accessed time on cached images. While the
  xattr driver uses the last accessed time reported by the underlying
  filesystem, the sqlite driver keeps track of its own last accessed
  time. The sqlite driver doesn't set [1] the last accessed time the
  very first time an image is added to cache. It updates [2] the last
  accessed time for every subsequent access of the image from cache.
  This behavior makes the newly cached images susceptible to cache
  pruning over older images because they don't have a last accessed time
  set[3]. So, whenever the pruner runs, it'll prune the newly cached
  images first and then look for older images.

  This bug may reduce Glance image download performance under certain
  traffic patterns as images will be served from Swift instead of image
  cache.

   [1] https://github.com/openstack/glance/blob/bb59c33ffcc6e1cde23c93bb25d38846e84c2cb9/glance/image_cache/drivers/sqlite.py#L324
  [2] https://github.com/openstack/glance/blob/bb59c33ffcc6e1cde23c93bb25d38846e84c2cb9/glance/image_cache/drivers/sqlite.py#L376
  [3] https://github.com/openstack/glance/blob/bb59c33ffcc6e1cde23c93bb25d38846e84c2cb9/glance/image_cache/drivers/sqlite.py#L280-L281

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1438564/+subscriptions


References