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 delete historical management command #579

Merged
merged 2 commits into from
Aug 31, 2023
Merged

Conversation

erikh360
Copy link
Contributor

No description provided.

Copy link
Contributor

@rudigiesler rudigiesler left a comment

Choose a reason for hiding this comment

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

Looks good! The only thing I can think of checking is does the database get locked when doing the delete? For especially the first deletes, that could mean that we can't do any inserts for a long period of time. I think that's why RapidPro gets all the IDs of messages to delete, and then deletes them in chunks: https://github.com/nyaruka/rp-archiver/blob/main/archives/messages.go#L170

@erikh360
Copy link
Contributor Author

Thanks @rudigiesler I didn't even think about table locking, according to the docs it looks like delete uses a RowExclusiveLock so it won't block other operations from completing.

It might still be useful to do it in chunks thought but I think I'll look at that in a separate PR.

@erikh360 erikh360 merged commit 0d8973c into develop Aug 31, 2023
1 check passed
@erikh360 erikh360 deleted the events-export-api branch August 31, 2023 07:15
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.

2 participants