Skip to content

Orphan Backup Migration Fix

What does this MR do and why?

  • Resolves major issue where backup moves were actually copies. This extended the migration time and risked impatient users closing out of the migration and potentially corrupting data while they waited.
  • Resolves major issue where an orphan* backup would cause the entire migration to crash.

*Orphan backup is currently being used to describe a case where a backup still exists in the backups table after it's referenced server has been removed from the servers table. There was at one point a bug where backups may not have been deleted when the server was deleted. This backref to a server that no longer existed was causing peewee to lose it's mind even when just referencing backup.server_id because the database engine was attempting to locate that record in the servers table.

How to set up and validate locally

  • Create a database pre 4.0.16 and create a server.
  • Delete that server.
  • Try to migrate from that version all the way to 4.4.1

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • Have you checked this doesn't interfere/conflict/duplicate someone elses work?
  • Have you fully tested your changes?
  • Have you resolved any lint issues?
  • Have you assigned a reviewer?
  • Have you applied correct labels?
Edited by Andrew

Merge request reports

Loading