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

backup: Allow for upgrade safe backups #13449

Merged
merged 6 commits into from
Jul 12, 2023

Commits on Jul 10, 2023

  1. backup: Allow for upgrade safe backups

    This adds functionality so that it's possible to use `Backup` and
    `BackupShard` and enforce that the backup created is safe to be used for
    upgrading MySQL.
    
    Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
    dbussink committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    5711806 View commit details
    Browse the repository at this point in the history
  2. Fix test output

    Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
    dbussink committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    39df823 View commit details
    Browse the repository at this point in the history
  3. backup: Add version number to manifest

    This adds the version number and upgrade safe state to the manifest. If
    these values are set, they are also validated on restore.
    
    For backwards compability we always allow still empty version numbers.
    
    Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
    dbussink committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    e8e6a2f View commit details
    Browse the repository at this point in the history
  4. Move restart logic into xtrabackupengine

    This already happens correctly with the shutdown for the builtin engine,
    where we're shutdown twice for `vtbackup` then. With this move we also
    properly honor the `UpgradeSafe` flag if the path is called through
    `Backup` or `BackupShard` vtctld commands.
    
    Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
    dbussink committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    3464590 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2023

  1. backup: Rework version detection

    It's not guaranteed that MySQL will always be up when doing a restore,
    this is shown in some of the failing tests with the changes so far.
    
    This means we need a way to get the MySQL version without having it
    running. We can though rely in `mysqlctld` being up. So this adds a new
    RPC to retrieve the version number through invoking the binary. This
    ensures we still get the right version also if we're running from the
    tablet as we'd execute the RPC.
    
    We also have less of a versioning issue here, as the vttablet + mysql
    are always upgraded together and the new mysqlctl is injected into the
    mysql container if needed so we don't have a version mismatch. So it's
    safe to do this in one step.
    
    Also decided to make the upgrade safe an explicit flag for `vtbackup` as
    well since overloading the existing flag was wonky and not really what
    we'd want. This makes it more explicit and safe.
    
    Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
    dbussink committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    b7e8178 View commit details
    Browse the repository at this point in the history
  2. Rename function

    Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
    dbussink committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    d149902 View commit details
    Browse the repository at this point in the history