Spec Lite: Add location url prefix

Change-Id: I9fa3da97db1064d28e66fc1be42fde1bf85524ab
This commit is contained in:
Abhishek Kekane 2019-05-21 07:13:21 +00:00
parent 9656932e7d
commit bc4d0c5f89
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,59 @@
..
This work is licensed under a Creative Commons Attribution 3.0 Unported
License.
http://creativecommons.org/licenses/by/3.0/legalcode
==========================================================
Spec Lite: Add location url prefix attribute to each store
==========================================================
:project: glance_store
:problem: In multiple store implementation, glance has added new metadata
'store' to location object, so that it will be easy to identify
the store that particular image is uploaded. When operator
upgrades glance node to use multiple stores, then
existing images does not have store information associated with
it. So if user wants to download any such particular image, then
as it does not have 'store' associated with it, the said image will
be searched in all the configured stores. This may cause the
performance overhead.
:solution: To overcome this, we propose to add new attribute '_url_prefix'
to each of the store object. When glance-api service starts it
stores a global map in the memory which includes store object,
scheme and location_class for each of the store.
Sample of location map stored in the memory::
{
'file_2': {
'store': <glance_store._drivers.filesystem.Store object>,
'store_entry': 'file',
'location_class': <class 'glance_store._drivers.filesystem.StoreLocation'>
},
'file_1': {
'store': <glance_store._drivers.filesystem.Store>,
'store_entry': 'file',
'location_class': <class 'glance_store._drivers.filesystem.StoreLocation'>
}
}
At the time of initialization of each store, a location url will
be retrieved using each stores configuration and assigned to
'_url_prefix' attribute of each store object. Whenever any GET call
to image (before upgrading to multiple stores) is made, the location
url of that image will be matched with '_url_prefix' and equivalent
store information will be updated to that image's location metadata.
:alternatives: None, carry on using current mechanism.
impacts: DocImpact
:timeline: Include in Train release.
:link: None
:assignee: abhishekk

View File

@ -13,4 +13,5 @@ Train approved specs for Glance:
:maxdepth: 1
glance/*
glance_store/*