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

LEAN-3814: delete migration backups that are older than 30 days at the start of every month #157

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mbetamony
Copy link
Contributor

No description provided.

Copy link
Contributor

@mnatsheh mnatsheh left a comment

Choose a reason for hiding this comment

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

I'm not sure about this approach, as each api pod will run this logic. Maybe we can expose an endpoint to delete backup entries created before a specific date, and have an external periodic job (e.g. a Literatum workflow) that calls this endpoint?

@mbetamony
Copy link
Contributor Author

I'm not sure about this approach, as each api pod will run this logic. Maybe we can expose an endpoint to delete backup entries created before a specific date, and have an external periodic job (e.g. a Literatum workflow) that calls this endpoint?

Yeah i see, we can do that.
Another option is to use postgres locks if we don't want the WM to be involved.
Let me know which of these you prefer.

@mbetamony
Copy link
Contributor Author

I'm not sure about this approach, as each api pod will run this logic. Maybe we can expose an endpoint to delete backup entries created before a specific date, and have an external periodic job (e.g. a Literatum workflow) that calls this endpoint?

Yeah i see, we can do that. Another option is to use postgres locks if we don't want the WM to be involved. Let me know which of these you prefer.

I added some changes to demonstrate what it would like if we do use locks; i used a transactional advisory lock, when a transaction ends it release the lock.

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

Successfully merging this pull request may close these issues.

3 participants