Skip to content

Fix: Enviroment & snapshot cleanup order #4228

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

VaggelisD
Copy link
Contributor

@VaggelisD VaggelisD commented Apr 23, 2025

Fixes #4055

This PR changes the order of deletions so that the actual views & physical tables are deleted before their state sync entries; This ensures that if the former fails, the state sync is not modified and a future sqlmesh janitor can pick up again the expired snapshots & environments on a later invocation.

@VaggelisD VaggelisD changed the title Fix: Enviroment & snapshot cleanup order in janitor Fix: Enviroment & snapshot cleanup order Apr 23, 2025
@VaggelisD VaggelisD force-pushed the vaggelisd/snapshot_deletion branch 2 times, most recently from 89d76c4 to 14d63c2 Compare April 23, 2025 10:38
@VaggelisD VaggelisD requested a review from a team April 23, 2025 15:26
@VaggelisD VaggelisD force-pushed the vaggelisd/snapshot_deletion branch from 8ef41bf to 3b9ba12 Compare April 28, 2025 09:00
@nickmuoh
Copy link
Contributor

I believe this PR would fix the following reported issues in the slack channel:

Copy link
Member

@izeigerman izeigerman left a comment

Choose a reason for hiding this comment

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

One minor comment. lgtm otherwise. Thanks a lot for addressing comments!

@VaggelisD VaggelisD force-pushed the vaggelisd/snapshot_deletion branch from d9b88f3 to c0b365f Compare April 29, 2025 15:52
@VaggelisD VaggelisD force-pushed the vaggelisd/snapshot_deletion branch from c0b365f to 415f2b6 Compare April 30, 2025 14:06
@VaggelisD VaggelisD merged commit 4e8228e into main May 1, 2025
23 checks passed
@VaggelisD VaggelisD deleted the vaggelisd/snapshot_deletion branch May 1, 2025 16:01
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.

Don't delete expired snapshots or environments records unless their associated data objects have been deleted
4 participants