Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add manila db purge job #142

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

fmount
Copy link
Collaborator

@fmount fmount commented Sep 27, 2023

Since Ocata release [1], Manila provides a utility command to purge deleted rows from database [2], and this command can be executed periodically to avoid database tables from getting bigger.
This patch introduces a Manila CronJob to periodically run manila-manage db purge, so that soft-deleted records are removed from Manila database.
The Cron scheduling is not exposed through the CR APIs but it's aligned with the default values defined for TripleO based deployments.

[1] https://specs.openstack.org/openstack/manila-specs/specs/ocata/add-db-manage-purge.html
[2] https://docs.openstack.org/manila/latest/cli/manila-manage.html

@openshift-ci openshift-ci bot requested a review from abays September 27, 2023 07:52
@fmount fmount requested review from silvacarloss and removed request for abays September 27, 2023 07:52
@fmount fmount force-pushed the db_purge branch 2 times, most recently from dd27f4f to e25e93d Compare September 27, 2023 09:09
fmount added a commit to fmount/openstack-must-gather that referenced this pull request Sep 27, 2023
As part of the gathering, collect the k8s CronJobs definition.
Manila added the db purge cronJob in [1], and keyston has already
a scheduled cronjob.

[1] openstack-k8s-operators/manila-operator#142

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
fmount added a commit to fmount/openstack-must-gather that referenced this pull request Sep 27, 2023
As part of the gathering, collect the k8s `CronJob` definitions.
`Manila`, for instance, added the db purge `cronJob` via [1], and
keystone has already a scheduled `cronjob` [2].

[1] openstack-k8s-operators/manila-operator#142
[2] https://github.com/openstack-k8s-operators/keystone-operator/blob/main/pkg/keystone/cronjob.go

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
@fmount
Copy link
Collaborator Author

fmount commented Sep 27, 2023

@fmount
Copy link
Collaborator Author

fmount commented Sep 27, 2023

@gouthampacha @silvacarloss if we manage to get this patch in before I create the dev-preview2 branch we can get this feature in.

@fmount
Copy link
Collaborator Author

fmount commented Sep 27, 2023

/test manila-operator-build-deploy-kuttl

Copy link
Contributor

@silvacarloss silvacarloss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, only one (likely stupid) question inline :)

pkg/manila/cronjob.go Show resolved Hide resolved
@silvacarloss
Copy link
Contributor

/lgtm

Since Ocata release [1], Manila provides a utility command to purge deleted rows
from database [2], and this command can be executed periodically to avoid
database tables from getting bigger.
This patch introduces a Manila CronJob to periodically run manila-manage db
purge, so that soft-deleted records are removed from Manila database.
The CronScheduling is not exposed through the CR API but it's aligned
with the default values defined for TripleO based deployments.

[1] https://specs.openstack.org/openstack/manila-specs/specs/ocata/add-db-manage-purge.html
[2] https://docs.openstack.org/manila/latest/cli/manila-manage.html

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
@fmount
Copy link
Collaborator Author

fmount commented Sep 27, 2023

/test manila-operator-build-deploy-tempest

Copy link
Contributor

@vhariria vhariria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to test files lgtm, thanks.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fmount, vhariria

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 91a9211 into openstack-k8s-operators:main Sep 27, 2023
8 checks passed
@silvacarloss
Copy link
Contributor

tardy lgtm - thanks for the changes, Francesco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants