-
Notifications
You must be signed in to change notification settings - Fork 10
Added management commands for archiving aggregates #422
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
Conversation
katydidnot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking like a great start, thanks for all your work.
I had a few comments in the swift.py file, but I think that's still WIP so go ahead and close those out if they're not helpful.
Just noting that we should also handle if the .env file swift variables aren't set as well.
* Added 'aggregate_archive_command' helper class that can be used for making archive commands * Added 'archive_link_aggregates' command * Added 'archive_user_aggregates' command * Added 'archive_pageproject_aggregates' command
katydidnot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a full review, but wanted to get you what feedback I have so far.
extlinks/aggregates/management/helpers/aggregate_archive_command.py
Outdated
Show resolved
Hide resolved
katydidnot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this locally against a swift docker container and was seeing an exception being thrown. Let me know if I'm missing any other setup.
suecarmol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this PR. I just have a minor comment and some nits, but otherwise this looks good!
suecarmol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your work on this PR. I can confirm that this now works on my local environment.
I was able to get the connection working and the logs to state that the files are being uploaded successfully, but when I go to list the container: Also, do we need to increase storage capacity of our object storage before merging this in? |
I was able to reproduce this if I didn't set the The |
Thanks for the tip, that did it. :) |
katydidnot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your work!
I'm sorry for not getting back to you sooner. I had already requested the increase with these backups in mind. Let's monitor the next few days' worth of uploads. I was calculating having 2/3 files per day of aggregates. If we see that my calculations were not accurate, we can ask for a storage increase again. |
Description
Added management commands for archiving aggregates.
Rationale
Our aggregates table is causing performance issues due to its large size. By moving old data out of it we hope to improve query performance.
Phabricator Ticket
https://phabricator.wikimedia.org/T370980
How Has This Been Tested?
The archival commands have been manually tested.
Archival Command Examples
The date option specifying the month to archive
--fromis required.--tois optional if a larger range of months is to be archived.The Swift container flag
--containeris optional and allows for uploading of archives to object storage after the archives are generated. Swift must be configured via environment variables for this option to work.Screenshots of your changes (if appropriate):
N/A
Types of changes
What types of changes does your code introduce? Add an
xin all the boxes that apply: