Skip to content

Let's cache layers size globally #9779

Closed

Description

@miminar

As a follow-up for #9115, let's cache layer sizes globally in a thread-safe
LRU cache. The solution in mentioned PR doesn't really utilize a cache because
during each new import, a new importer is created, whose Import() method is
invoked just once.

Let the cache be shared accross for all the imports happening in image import
controller.

Activity

  1. liggitt commented on Jul 11, 2016

    @liggitt
    Contributor

    seems ok, but we need to be sure we don't use that cache in a way that lets us skip auth checks across imagestreams

  2. miminar commented on Jul 11, 2016

    @miminar
    Author

    @liggitt can you please elaborate? Is there a harm in fetching layer sizes from a global cache regardless of source/target namespace? With such a tolerant implementation, a user will be able to obtain layer sizes of blobs belonging to images he doesn't have access to (if he's able to guess the layer names). Even so, is the size of any value to him (taking into consideration that size is already contained in image manifest).

  3. liggitt commented on Jul 11, 2016

    @liggitt
    Contributor

    as long as presence and size data in the shared cache isn't used as a short-circuiting check as part of layer access elsewhere (which I suspect may be happening in pullthroughblobstore with cachedLayers)

  4. miminar commented on Jul 11, 2016

    @miminar
    Author

    as long as presence and size data in the shared cache isn't used as a short-circuiting check as part of layer access elsewhere (which I suspect may be happening in pullthroughblobstore with cachedLayers)

    @liggitt no, the authorization check will be done per imagestream. This will be used just for filling missing image sizes for quota purposes.

    Anyway I suppose this issue and proposed solution will be superseded by #9755 (comment)

  5. self-assigned this
    on Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions