bin/glance and caching sqlite driver column discrepancies

Bug #888343 reported by Dan Prince
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Brian Waldon

Bug Description

I'm seeing some discrepancies with what bin/glance uses and what the sqlite image cache driver provides.

bin/glance looks for:

image['id']
image['expected_size']
image['last_accessed']

Our existing sqlite table however contains the following columns:

                CREATE TABLE IF NOT EXISTS cached_images (
                    image_id TEXT PRIMARY KEY,
                    last_access REAL DEFAULT 0.0,
                    last_modified REAL DEFAULT 0.0,
                    size INTEGER DEFAULT 0,
                    hits INTEGER DEFAULT 0,
                    checksum TEXT
                );

-bin/glance needs to be update to use 'image_id' and 'last_access'.

-we appear to need the expected_size column added to our sqlite DB.

Dan Prince (dan-prince)
Changed in glance:
assignee: nobody → Dan Prince (dan-prince)
status: New → In Progress
Revision history for this message
Dan Prince (dan-prince) wrote :

To be clear. Most of the cache- commands in bin/glance appear to be affected by this issue:

Cache Commands:

    cache-index List all images currently cached

    cache-invalid List current invalid cache images

    cache-incomplete List images currently being fetched

    cache-prefetching List images that are being prefetched

    cache-prefetch Pre-fetch an image or list of images into the cache

    cache-purge Purges an image from the cache

    cache-clear Removes all images from the cache

    cache-reap-invalid Reaps any invalid images that were left for
                         debugging purposes

    cache-reap-stalled Reaps any stalled incomplete images

Changed in glance:
importance: Undecided → High
Revision history for this message
Jay Pipes (jaypipes) wrote :

I'm in the process of removing all the cache management stuff from bin/glance...

See: https://bugs.launchpad.net/glance/+bug/837817

Revision history for this message
Jay Pipes (jaypipes) wrote :

Also. I'm not planning on adding expected_size to the cache. That information is queryable via the registry and does not need to be duplicated in the cache IMHO

Revision history for this message
Dan Prince (dan-prince) wrote :

 Wow. It seems like these commands would be really useful to someone who wants to interact w/ the caching API.

Ticket #837817 mentions handling the case where the caching management API is disabled more gracefully. Removing the cache management stuff from bin/glance entirely seems like it is a bit heavy handed. Should OPS teams plan on rolling their own tool to interact with the caches via the API?

---

On the expected_size stuff I'd be fine with removing that functionality from bin/glance. The rest of the changes should be fairly minor.

Revision history for this message
Jay Pipes (jaypipes) wrote :

LOL :) I didn't mean I was removing the ability to manage the cache :) I just meant I was removing it from the bin/glance tool and putting it in a separate bin/glance-cache-manage tool

Revision history for this message
Jay Pipes (jaypipes) wrote :

Sorry about the confusion, Dan! :)

Revision history for this message
Dan Prince (dan-prince) wrote :

Jay. If you already have this in progress why don't you just take this one? I want this fixed but no need to duplicate efforts.

Revision history for this message
Dan Prince (dan-prince) wrote :

Jay: Any updates? Are you working on this in a separate branch or should someone on titan/ozone take a look?

Jay Pipes (jaypipes)
Changed in glance:
milestone: none → essex-2
Dan Prince (dan-prince)
Changed in glance:
assignee: Dan Prince (dan-prince) → Jay Pipes (jaypipes)
Jay Pipes (jaypipes)
Changed in glance:
assignee: Jay Pipes (jaypipes) → Brian Waldon (bcwaldon)
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/2373
Committed: http://github.com/openstack/glance/commit/16a591a00d814882e1433ffc2413fc63d9591d78
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 16a591a00d814882e1433ffc2413fc63d9591d78
Author: Brian Waldon <email address hidden>
Date: Thu Dec 15 12:15:51 2011 -0500

    Removing caching cruft from bin/glance

    Fixes bug 888343

    Change-Id: Ief0ca93a073f8235afd98ca79f8033fef66260e3

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to glance (milestone-proposed)

Reviewed: https://review.openstack.org/2380
Committed: http://github.com/openstack/glance/commit/0d2bffa64a0e37b69d5c7e8b09a70c4ecc5a2752
Submitter: Jenkins
Branch: milestone-proposed

 tag in-milestone-proposed
 done

commit 0d2bffa64a0e37b69d5c7e8b09a70c4ecc5a2752
Author: Brian Waldon <email address hidden>
Date: Thu Dec 15 12:15:51 2011 -0500

    Removing caching cruft from bin/glance

    Fixes bug 888343

    Change-Id: Ief0ca93a073f8235afd98ca79f8033fef66260e3

Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: essex-2 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.