Support configurable dogpile cache expiration

The [cache]/expiration_time currently caches items for the default
of 600s and is not configurable via the charm. This change adds a
dogpile-cache-expiration config option that will default to 600s
so as not to cause any behavior changes by default.

Closes-Bug: #1899117
Change-Id: I639b2b77d5db69744897b6798613a797d05fe23b
Co-authored-by: Chris MacNaughton <chris.macnaughton@canonical.com>
This commit is contained in:
Corey Bryant 2021-04-06 16:31:27 +00:00 committed by Chris MacNaughton
parent 3643aa963c
commit 152e5b6cfe
6 changed files with 24 additions and 0 deletions

View File

@ -107,6 +107,13 @@ options:
type: int
default: 60
description: Amount of time (in seconds) the catalog should be cached for.
dogpile-cache-expiration:
type: int
default: 600
description: |
Amount of time (in seconds) to cache items in the dogpile.cache. This
only applies to cached methods that do not have an explicitly defined
cache expiration time.
fernet-max-active-keys:
type: int
default: 3

View File

@ -202,6 +202,7 @@ class KeystoneContext(context.OSContextGenerator):
ctxt['verbose'] = config('verbose')
ctxt['token_expiration'] = config('token-expiration')
ctxt['catalog_cache_expiration'] = config('catalog-cache-expiration')
ctxt['dogpile_cache_expiration'] = config('dogpile-cache-expiration')
ctxt['identity_backend'] = config('identity-backend')
ctxt['assignment_backend'] = config('assignment-backend')

View File

@ -51,6 +51,9 @@ expiration = {{ token_expiration }}
{% include "parts/section-signing" %}
{% include "section-oslo-cache" %}
# This goes in the section above, selectively
# Bug #1899117
expiration_time = {{ dogpile_cache_expiration }}
[policy]
driver = sql
@ -112,3 +115,4 @@ admin_project_name = admin
# This goes in the section above, selectively
# Bug #1819134
max_request_body_size = 114688

View File

@ -60,6 +60,9 @@ max_active_keys = {{ fernet_max_active_keys }}
{% include "parts/section-signing" %}
{% include "section-oslo-cache" %}
# This goes in the section above, selectively
# Bug #1899117
expiration_time = {{ dogpile_cache_expiration }}
[policy]
driver = sql
@ -134,3 +137,4 @@ admin_project_name = admin
# This goes in the section above, selectively
# Bug #1819134
max_request_body_size = 114688

View File

@ -59,6 +59,9 @@ max_active_keys = {{ fernet_max_active_keys }}
{% include "parts/section-signing" %}
{% include "section-oslo-cache" %}
# This goes in the section above, selectively
# Bug #1899117
expiration_time = {{ dogpile_cache_expiration }}
[policy]
driver = sql
@ -133,3 +136,4 @@ admin_project_name = admin
# This goes in the section above, selectively
# Bug #1819134
max_request_body_size = 114688

View File

@ -50,6 +50,9 @@ max_active_keys = {{ fernet_max_active_keys }}
{% include "parts/section-signing" %}
{% include "section-oslo-cache" %}
# This goes in the section above, selectively
# Bug #1899117
expiration_time = {{ dogpile_cache_expiration }}
[policy]
driver = sql
@ -117,3 +120,4 @@ admin_project_name = admin
# This goes in the section above, selectively
# Bug #1819134
max_request_body_size = 114688