Add manila db purge job
This patch introduces manila_api_cron container to run manila db purge job periodically, so that soft-deleted records are removed from Manila database. Closes-Bug: #1891890 Depends-on: https://review.opendev.org/#/c/746131/ Depends-on: https://review.opendev.org/#/c/746427/ Change-Id: Iae7e0ec1ee964c2c23a3bf0c64c0387e82733a4e
This commit is contained in:
parent
d0842812c8
commit
a453f1b599
@ -57,6 +57,51 @@ parameters:
|
||||
When not set, the list is inferred via the storage back end/s
|
||||
enabled.
|
||||
type: comma_delimited_list
|
||||
ManilaCronDbPurgeMinute:
|
||||
type: string
|
||||
description: >
|
||||
Cron to purge db entries marked as deleted and older than $age - Minute
|
||||
default: '1'
|
||||
ManilaCronDbPurgeHour:
|
||||
type: string
|
||||
description: >
|
||||
Cron to purge db entries marked as deleted and older than $age - Hour
|
||||
default: '0'
|
||||
ManilaCronDbPurgeMonthday:
|
||||
type: string
|
||||
description: >
|
||||
Cron to purge db entries marked as deleted and older than $age - Month Day
|
||||
default: '*'
|
||||
ManilaCronDbPurgeMonth:
|
||||
type: string
|
||||
description: >
|
||||
Cron to purge db entries marked as deleted and older than $age - Month
|
||||
default: '*'
|
||||
ManilaCronDbPurgeWeekday:
|
||||
type: string
|
||||
description: >
|
||||
Cron to purge db entries marked as deleted and older than $age - Week Day
|
||||
default: '*'
|
||||
ManilaCronDbPurgeUser:
|
||||
type: string
|
||||
description: >
|
||||
Cron to purge db entries marked as deleted and older than $age - User
|
||||
default: 'manila'
|
||||
ManilaCronDbPurgeAge:
|
||||
type: string
|
||||
description: >
|
||||
Cron to purge db entries marked as deleted and older than $age - Age
|
||||
default: '30'
|
||||
ManilaCronDbPurgeDestination:
|
||||
type: string
|
||||
description: >
|
||||
Cron to purge db entries marked as deleted and older than $age - Log destination
|
||||
default: '/var/log/manila/manila-rowsflush.log'
|
||||
ManilaCronDbPurgeMaxDelay:
|
||||
type: string
|
||||
description: >
|
||||
Cron to purge db entries marked as deleted and older than $age - Max Delay
|
||||
default: '3600'
|
||||
|
||||
conditions:
|
||||
|
||||
@ -157,6 +202,15 @@ outputs:
|
||||
manila::api::enable_proxy_headers_parsing: true
|
||||
manila::api::default_share_type: 'default'
|
||||
manila_enabled_share_protocols: {get_param: ManilaEnabledShareProtocols}
|
||||
manila::cron::db_purge::minute: {get_param: ManilaCronDbPurgeMinute}
|
||||
manila::cron::db_purge::hour: {get_param: ManilaCronDbPurgeHour}
|
||||
manila::cron::db_purge::monthday: {get_param: ManilaCronDbPurgeMonthday}
|
||||
manila::cron::db_purge::month: {get_param: ManilaCronDbPurgeMonth}
|
||||
manila::cron::db_purge::weekday: {get_param: ManilaCronDbPurgeWeekday}
|
||||
manila::cron::db_purge::user: {get_param: ManilaCronDbPurgeUser}
|
||||
manila::cron::db_purge::age: {get_param: ManilaCronDbPurgeAge}
|
||||
manila::cron::db_purge::destination: {get_param: ManilaCronDbPurgeDestination}
|
||||
manila::cron::db_purge::maxdelay: {get_param: ManilaCronDbPurgeMaxDelay}
|
||||
- manila::wsgi::apache::servername:
|
||||
str_replace:
|
||||
template:
|
||||
@ -201,6 +255,17 @@ outputs:
|
||||
- path: /var/log/manila
|
||||
owner: manila:manila
|
||||
recurse: true
|
||||
/var/lib/kolla/config_files/manila_api_cron.json:
|
||||
command: /usr/sbin/crond -n
|
||||
config_files:
|
||||
- source: "/var/lib/kolla/config_files/src/*"
|
||||
dest: "/"
|
||||
merge: true
|
||||
preserve_properties: true
|
||||
permissions:
|
||||
- path: /var/log/manila
|
||||
owner: manila:manila
|
||||
recurse: true
|
||||
docker_config:
|
||||
step_2:
|
||||
manila_init_logs:
|
||||
@ -252,6 +317,24 @@ outputs:
|
||||
- []
|
||||
environment:
|
||||
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
|
||||
manila_api_cron:
|
||||
image: *manila_api_image
|
||||
net: host
|
||||
user: root
|
||||
privileged: false
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: '/usr/share/openstack-tripleo-common/healthcheck/cron manila'
|
||||
volumes:
|
||||
list_concat:
|
||||
- {get_attr: [ContainersCommon, volumes]}
|
||||
-
|
||||
- /var/lib/kolla/config_files/manila_api_cron.json:/var/lib/kolla/config_files/config.json:ro
|
||||
- /var/lib/config-data/puppet-generated/manila:/var/lib/kolla/config_files/src:ro
|
||||
- /var/log/containers/manila:/var/log/manila:z
|
||||
- /var/log/containers/httpd/manila-api:/var/log/httpd:z
|
||||
environment:
|
||||
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
|
||||
metadata_settings:
|
||||
get_attr: [ApacheServiceBase, role_data, metadata_settings]
|
||||
deploy_steps_tasks:
|
||||
|
6
releasenotes/notes/manila-db-purge-811512391617216d.yaml
Normal file
6
releasenotes/notes/manila-db-purge-811512391617216d.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The ``manila_api_cron`` container has been introduced, which executes db
|
||||
purge job for Manila service. Use ManilaCronDbPurge* parameters to override
|
||||
cron parameters.
|
Loading…
Reference in New Issue
Block a user