Removed 'store_capabilities_update_min_interval' config option

Removed 'store_capabilities_update_min_interval' configuration
option which was scheduled to remove during Stein development
cycle.

Change-Id: I1a6cfa45b5a37eacb4ba158b62fe619e1b1c9dff
This commit is contained in:
Abhishek Kekane 2019-05-24 06:21:08 +00:00
parent 4a037ee00c
commit d0d883e16d
4 changed files with 0 additions and 150 deletions

View File

@ -108,56 +108,6 @@ Possible values:
Related Options: Related Options:
* stores * stores
"""),
cfg.IntOpt('store_capabilities_update_min_interval',
default=0,
min=0,
deprecated_for_removal=True,
deprecated_since='Rocky',
deprecated_reason="""
This option configures a stub method that has not been implemented
for any existing store drivers. Hence it is non-operational, and
giving it a value does absolutely nothing.
This option is scheduled for removal early in the Stein development
cycle.
""",
help="""
Minimum interval in seconds to execute updating dynamic storage
capabilities based on current backend status.
Provide an integer value representing time in seconds to set the
minimum interval before an update of dynamic storage capabilities
for a storage backend can be attempted. Setting
``store_capabilities_update_min_interval`` does not mean updates
occur periodically based on the set interval. Rather, the update
is performed at the elapse of this interval set, if an operation
of the store is triggered.
By default, this option is set to zero and is disabled. Provide an
integer value greater than zero to enable this option.
NOTE 1: For more information on store capabilities and their updates,
please visit: https://specs.openstack.org/openstack/glance-specs/\
specs/kilo/store-capabilities.html
For more information on setting up a particular store in your
deployment and help with the usage of this feature, please contact
the storage driver maintainers listed here:
https://docs.openstack.org/glance_store/latest/user/drivers.html
NOTE 2: The dynamic store update capability described above is not
implemented by any current store drivers. Thus, this option DOES
NOT DO ANYTHING (and it never has). It is DEPRECATED and scheduled
for removal early in the Stein development cycle.
Possible values:
* Zero
* Positive integer
Related Options:
* None
"""), """),
] ]

View File

@ -17,10 +17,8 @@
import logging import logging
import threading import threading
import time
import enum import enum
from eventlet import tpool
from oslo_utils import reflection from oslo_utils import reflection
from glance_store import exceptions from glance_store import exceptions
@ -141,56 +139,9 @@ class StoreCapability(object):
self._capabilities &= ~caps self._capabilities &= ~caps
def _schedule_capabilities_update(store):
def _update_capabilities(store, context):
with context['lock']:
if context['updating']:
return
context['updating'] = True
try:
store.update_capabilities()
except Exception:
pass
finally:
context['updating'] = False
# NOTE(zhiyan): Update 'latest_update' field
# in anyway even an exception raised, to
# prevent call problematic routine cyclically.
context['latest_update'] = int(time.time())
global _STORE_CAPABILITES_UPDATE_SCHEDULING_BOOK
book = _STORE_CAPABILITES_UPDATE_SCHEDULING_BOOK
if store not in book:
with _STORE_CAPABILITES_UPDATE_SCHEDULING_LOCK:
if store not in book:
book[store] = {'latest_update': int(time.time()),
'lock': threading.Lock(),
'updating': False}
else:
context = book[store]
# NOTE(zhiyan): We don't need to lock 'latest_update'
# field for check since time increased one-way only.
sec = (int(time.time()) - context['latest_update'] -
store.conf.glance_store.store_capabilities_update_min_interval)
if sec >= 0:
if not context['updating']:
# NOTE(zhiyan): Using a real thread pool instead
# of green pool due to store capabilities updating
# probably calls some inevitably blocking code for
# IO operation on remote or local storage.
# Eventlet allows operator to uses environment var
# EVENTLET_THREADPOOL_SIZE to desired pool size.
tpool.execute(_update_capabilities, store, context)
def check(store_op_fun): def check(store_op_fun):
def op_checker(store, *args, **kwargs): def op_checker(store, *args, **kwargs):
# NOTE(zhiyan): Trigger the hook of updating store
# dynamic capabilities based on current store status.
if store.conf.glance_store.store_capabilities_update_min_interval > 0:
_schedule_capabilities_update(store)
get_capabilities = [ get_capabilities = [
BitMasks.READ_ACCESS, BitMasks.READ_ACCESS,
BitMasks.READ_OFFSET if kwargs.get('offset') else BitMasks.NONE, BitMasks.READ_OFFSET if kwargs.get('offset') else BitMasks.NONE,

View File

@ -42,56 +42,6 @@ storing images. If not set, Glance API service will fail to start.
Related Options: Related Options:
* enabled_backends * enabled_backends
""")),
cfg.IntOpt('store_capabilities_update_min_interval',
default=0,
min=0,
deprecated_for_removal=True,
deprecated_since='Rocky',
deprecated_reason=_("""
This option configures a stub method that has not been implemented
for any existing store drivers. Hence it is non-operational, and
giving it a value does absolutely nothing.
This option is scheduled for removal early in the Stein development
cycle.
"""),
help=_("""
Minimum interval in seconds to execute updating dynamic storage
capabilities based on current backend status.
Provide an integer value representing time in seconds to set the
minimum interval before an update of dynamic storage capabilities
for a storage backend can be attempted. Setting
``store_capabilities_update_min_interval`` does not mean updates
occur periodically based on the set interval. Rather, the update
is performed at the elapse of this interval set, if an operation
of the store is triggered.
By default, this option is set to zero and is disabled. Provide an
integer value greater than zero to enable this option.
NOTE 1: For more information on store capabilities and their updates,
please visit: https://specs.openstack.org/openstack/glance-specs/\
specs/kilo/store-capabilities.html
For more information on setting up a particular store in your
deployment and help with the usage of this feature, please contact
the storage driver maintainers listed here:
https://docs.openstack.org/glance_store/latest/user/drivers.html
NOTE 2: The dynamic store update capability described above is not
implemented by any current store drivers. Thus, this option DOES
NOT DO ANYTHING (and it never has). It is DEPRECATED and scheduled
for removal early in the Stein development cycle.
Possible values:
* Zero
* Positive integer
Related Options:
* None
""")), """)),
] ]

View File

@ -70,7 +70,6 @@ class OptsTestCase(base.StoreBaseTest):
expected_opt_names = [ expected_opt_names = [
'default_store', 'default_store',
'stores', 'stores',
'store_capabilities_update_min_interval',
'cinder_api_insecure', 'cinder_api_insecure',
'cinder_ca_certificates_file', 'cinder_ca_certificates_file',
'cinder_catalog_info', 'cinder_catalog_info',