-
Notifications
You must be signed in to change notification settings - Fork 4
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
TP2000-1407 Sqlite dump failure fix #1265
Conversation
The class name refactor provides a more specific description of its functionality and prepares for another, similar, but different storage class. The functionality refactor moves export creation behaviour into the storage class for better encapsulation.
""" | ||
|
||
@log_timing(logger_function=logger.info) | ||
def export_database(self, filename: str): |
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.
Is it possible to test this function?
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.
It's implicitly tested as part of test_s3_export_task_uploads() - called within the export_and_upload_sqlite() function, which I think gives it full and sufficient coverage.
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.
It's showing up for me as red in codecov. Is that right? Can you check it on your end as well and confirm?
@@ -11,20 +11,39 @@ | |||
|
|||
|
|||
class Command(BaseCommand): | |||
help = ( | |||
"Create a snapshot of the application database to a file in SQLite " |
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.
Is this command tested? This whole file is not showing up in the coverage report. Not sure if that's a bug with codecov or not
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.
It looks as though there's never been a test for this command. I can only guess that's because it's fairly simple and the function it executes is tested by exporter/tests/test_sqlite.py.
Test now added. Btw, export_and_upload_sqlite()
is mocked in that test because it's tested elsewhere and is relatively expensive to execute - each execution performs a manage.py makemigrations
followed by a manage.py migrate
amongst other things!
TP2000-1407 Sqlite dump failure fix
Why
Until recently, the SQLite export to S3 capability was taking over four hours to complete. With a continued increase in database size, export performance had sharply degraded and was taking in the region of three days to complete. Performance improvements were required.
What
This PR:
SQLiteLocalStorage
andSQLiteS3Storage
to apply the different storage strategies.common
application for wider use.dump_sqlite
Django management command.Checklist