gerhard
(Gerhard Schlager)
Janvier 14, 2020, 2:09
42
J’ai récemment apporté de nombreuses améliorations au processus de restauration et d’autres sont prévues. La demande d’extraction contient une description de haut niveau des modifications.
master ← gschlager:backup_refactor
merged 10:41AM - 14 Jan 20 UTC
Lots of refactoring to make the code easier to test as well as fixing of bugs an… d doing some house cleaning.
The highlights are:
* `Restorer` has been split up into multiple classes to allow easier testing with as little stubbing as possible.
* All backups are directly restored into the `public` schema, because only very old database dumps can be restored into the `backup` schema. This simplifies that part of the restore process a lot.
* Restoring into PostgreSQL 11+ works.
* Better error handling and detection during the restore of the database dump.
* Restoring of backups from all major versions since v1.1 has been tested and various bugs for older versions have been fixed.
* The restore process really waits for Sidekiq to pause instead of just claiming that it does.
* Bugs in remapping of uploads have been fixed and there are tons of tests for it.
* Less disk space needed during restore, because uploads do not get copied before the migration to S3 anymore.
* Database runs as a new system process (`rake db:migrate`) instead of using the same process as the restore. This should fix a couple of weird bugs related to DB migrations. It's always migrating to the latest available DB migration (including plugin and post migrations). That simplifies that part of the code by a lot and prevents issues we previously saw with plugin migrations or missing post migrations.
* Most of the logic of the `migrate_to_s3` rake task was moved into the `ToS3Migration` class. This should make it easier to add tests in the future. All `exit` calls were replaced with exceptions to make it easier to handle exceptions during the restore process.
* Lots of other, smaller bugfixes and improvements.
* Roughly 200 new specs.
Je clôture ce rapport de bug comme étant corrigé. Veuillez créer un nouveau rapport de bug si vous rencontrez une erreur lors d’une restauration et que vous utilisez la version de Discourse « tests-passed ».
8 « J'aime »