Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-39061

mariadb-backup compatible wrappers for BACKUP SERVER

    XMLWordPrintable

Details

    Description

      The server-side BACKUP SERVER statement (MDEV-14992) is a fundamentally different way of performing backups, compared to the current mariadb-backup tool. Likewise, streaming backup (MDEV-38362) will necessarily be quite different from what we have now.

      While many concepts are different, it should be possible to implement a partial compatibility layer for the mariadb-backup and mbstream tools, so that existing scripts around backup can continue to work with minimal changes.

      The mariadb-backup compatible tool would invoke either BACKUP SERVER in a client connection for backup operation, or mariadbd itself for prepare operation. Some operations, such as copy_back or move_back, could be implemented by invoking mysys functions. The tool would also have to examine the metadata in the specified directory.

      This will have to be designed in detail once MDEV-14992 has been completed.

      Designing and implementing support for streaming operations is obviously blocked by MDEV-38362. The mbstream compatible tool would be a wrapper for tar x, assuming that we adopt the POSIX tar format.

      Currently, mbstream supported options are

      -x   or --extract
      -c  or  --create
      -C  or --directory
      -v  or --verbose
      -p  or --parallel
      -?  or --help
      

      All options except --parallel or -p are available in the GNU tar tool.

      A minimal mbstream work-a-like would be a shell script like this:

      #!/bin/sh
      # Note: We do not try to reject options that are valid in tar and invalid in mbstream
      # Note: --parallel is not valid in GNU tar
      # Note: -p (--preserve-permissions) in GNU tar does not take an argument like it does in mbstream
      exec tar "$@"
      

      An alternative for interactive use would be to add the following to $HOME/.bashrc or the start-up of a compatible shell:

      alias mbstream=tar
      

      To have a true drop-in replacement, a better wrapper script that properly filters out p and -parallel can be built around the getopt(1) utility. We will need a test suite that demonstrates that all parameters are parsed in a compatible way. Special attention needs to be paid on $IFS (for example, if some arguments contain spaces) and on variants of passing arguments: mbstream -xp4 and mbstream -p4 x are valid, mbstream -p4x or mbstream -px 4 are not.

      For mariadb-backup we would create a nontrivial Bourne shell script that would invoke tools like mariadbd, mariadb, cp, mv as needed.

      These wrapper scripts would be called mariadb-backup and mbstream just like their legacy counterparts, but unlike them, installed in a directory that is not in the $PATH. To put them into use, one would execute a command like the following:

      export PATH=/path/to/the/wrappers:"$PATH"
      

      or

      PATH=/path/to/the/wrappers:"$PATH" my-legacy-backup-script
      

      When a tweaked $PATH is in effect, the command names mariadb-backup and mbstream would invoke the wrapper scripts, not the legacy utilities.

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.