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

Remove innobackupex mode from Mariabackup

Details

    • New Feature
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Backup, mariabackup
    • None

    Description

      Mariabackup has an --innobackupex option, which can be used to enable innobackupex mode.

      https://mariadb.com/kb/en/library/mariabackup-options/#-innobackupex

      This is a compatibility option:

      The primary purpose of innobackupex mode is to allow scripts and tools to more easily migrate to Mariabackup if they were originally designed to use the innobackupex utility that is included with Percona XtraBackup. It is not recommended to use this mode in new scripts, since it is not guaranteed to be supported forever.

      This mode is not very different from the normal mode. The listed differences are:

      • To prepare a backup, the --apply-log option is used instead of the --prepare option.
      • To create an incremental backup, the --incremental option is supported.
      • The --no-timestamp option is supported.
      • To create a partial backup, the --include option is used instead of the --tables option.
      • To create a partial backup, the --databases option can still be used, but it's behavior changes slightly.
      • The --target-dir option is not used to specify the backup directory. The backup directory should instead be specified as a standalone argument.

      These differences are not very significant, and having this extra mode is a bit confusing.

      Maybe some of the behavioral differences in innobackupex mode should be merged into Mariabackup's normal mode, and then we should remove innobackupex mode?

      UPDATE 14 Aug 2023
      This task needs to be about:

      • verifying/ensuring that all innobackupex functionality is available in the normal mode (list to be updated)
        • add "timestamp" option
        • deprecation message for innobackupex (MDEV-31505)

      Attachments

        Issue Links

          Activity

            vlad.lesin Vladislav Lesin added a comment - - edited

            ralf.gebhardt asked me, what options do we loose and what is the alternative options.

            1. --innobackupex --apply-log is the same as --prepare;

            2. --innobackupex --incremental is the same as --incremental-dir, example:

            mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --incremental --no-timestamp --incremental-basedir=$targetdir/full $targetdir/inc;
            mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --apply-log $targetdir/full;
            mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --apply-log --incremental-dir=$targetdir/inc $targetdir/full;
            

            can be exchanged with:

            mariabackup --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --incremental-basedir=$targetdir/full --target-dir=$targetdir/inc;
            mariabackup --defaults-file=$MYSQLTEST_VARDIR/my.cnf --prepare --target-dir=$targetdir/full;
            mariabackup --defaults-file=$MYSQLTEST_VARDIR/my.cnf --prepare --incremental-dir=$targetdir/inc --target-dir=$targetdir/full;
            

            3. --no-timestamp is the default mode for mariabackup, see the above example;

            4. --include and --tables are the same

            5. --databases - according to the code in ibx_init():

              if (opt_ibx_databases != NULL) {
                if (is_path_separator(*opt_ibx_databases)) {
                  xtrabackup_databases_file = opt_ibx_databases;
                } else {
                  xtrabackup_databases = opt_ibx_databases;
                }
              }
            

            --innobackupex --databases can contain both the list of databases/tables and a file name which contains the list of databases/tables, while just --databases can contain only the list of databases/tables, while for the file there is another option --databases_file.

            6. --target_dir is omitted in innobackupex mode, just target directory path is required, what is the same as --target_dir in mariabackup, see the example above.

            I would say we don't loose any functionality, all innobackupex options have alternative mariabackup options.

            vlad.lesin Vladislav Lesin added a comment - - edited ralf.gebhardt asked me, what options do we loose and what is the alternative options. 1. --innobackupex --apply-log is the same as --prepare; 2. --innobackupex --incremental is the same as --incremental-dir, example: mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --incremental --no-timestamp --incremental-basedir=$targetdir/full $targetdir/inc; mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --apply-log $targetdir/full; mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --apply-log --incremental-dir=$targetdir/inc $targetdir/full; can be exchanged with: mariabackup --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --incremental-basedir=$targetdir/full --target-dir=$targetdir/inc; mariabackup --defaults-file=$MYSQLTEST_VARDIR/my.cnf --prepare --target-dir=$targetdir/full; mariabackup --defaults-file=$MYSQLTEST_VARDIR/my.cnf --prepare --incremental-dir=$targetdir/inc --target-dir=$targetdir/full; 3. --no-timestamp is the default mode for mariabackup, see the above example; 4. --include and --tables are the same 5. --databases - according to the code in ibx_init(): if (opt_ibx_databases != NULL) { if (is_path_separator(*opt_ibx_databases)) { xtrabackup_databases_file = opt_ibx_databases; } else { xtrabackup_databases = opt_ibx_databases; } } --innobackupex --databases can contain both the list of databases/tables and a file name which contains the list of databases/tables, while just --databases can contain only the list of databases/tables, while for the file there is another option --databases_file. 6. --target_dir is omitted in innobackupex mode, just target directory path is required, what is the same as --target_dir in mariabackup, see the example above. I would say we don't loose any functionality, all innobackupex options have alternative mariabackup options.

            What do we gain by removing it? Is this mode only about remapping of command-line options or are there deeper differences?

            serg Sergei Golubchik added a comment - What do we gain by removing it? Is this mode only about remapping of command-line options or are there deeper differences?

            serg This mode is only for options remapping, https://mariadb.com/kb/en/mariabackup-options/#-innobackupex. This task can be considered as a part of MDEV-23695. innobackupex was removed from xtrabackup in December 2018.

            vlad.lesin Vladislav Lesin added a comment - serg This mode is only for options remapping, https://mariadb.com/kb/en/mariabackup-options/#-innobackupex . This task can be considered as a part of MDEV-23695 . innobackupex was removed from xtrabackup in December 2018.

            if it's only option remapping, this seems like a small and easy to maintain chunk of code. May be it'd be better to keep it for compatibility reasons?

            serg Sergei Golubchik added a comment - if it's only option remapping, this seems like a small and easy to maintain chunk of code. May be it'd be better to keep it for compatibility reasons?

            serg It's about 1k lines of code which just duplicates the code from another .cc file, has it's own "my option" array (which duplicates mariabackup options with some small changes) with it's own "handle_options" function with it's own "get_one_option" callback. And all of this is only to copy one variables to another ones, like

             /*=====================*/                                                     
              xtrabackup_copy_back = opt_ibx_copy_back;                                     
              xtrabackup_move_back = opt_ibx_move_back;                                     
              opt_galera_info = opt_ibx_galera_info;                                        
              opt_slave_info = opt_ibx_slave_info;                                          
              opt_no_lock = opt_ibx_no_lock;                                                
              opt_safe_slave_backup = opt_ibx_safe_slave_backup;                            
              opt_rsync = opt_ibx_rsync;                                                    
              opt_force_non_empty_dirs = opt_ibx_force_non_empty_dirs;                      
              opt_noversioncheck = opt_ibx_noversioncheck;                                  
              opt_no_backup_locks = opt_ibx_no_backup_locks;                                
              opt_decompress = opt_ibx_decompress;                                          
            

            There is no effort to maintain it at all(I think this is because there is almost no difference between innobackupex and mariabackup options, and because nobody use innobackupex, and we don't have related bug reports). And you are correct, we gain nothing in functionality too by removing it. It's just code clean-up task to get rid of copy-pasted code. And if we really need the compatibility with innobackupex, we can keep it.

            vlad.lesin Vladislav Lesin added a comment - serg It's about 1k lines of code which just duplicates the code from another .cc file, has it's own "my option" array (which duplicates mariabackup options with some small changes) with it's own "handle_options" function with it's own "get_one_option" callback. And all of this is only to copy one variables to another ones, like /*=====================*/ xtrabackup_copy_back = opt_ibx_copy_back; xtrabackup_move_back = opt_ibx_move_back; opt_galera_info = opt_ibx_galera_info; opt_slave_info = opt_ibx_slave_info; opt_no_lock = opt_ibx_no_lock; opt_safe_slave_backup = opt_ibx_safe_slave_backup; opt_rsync = opt_ibx_rsync; opt_force_non_empty_dirs = opt_ibx_force_non_empty_dirs; opt_noversioncheck = opt_ibx_noversioncheck; opt_no_backup_locks = opt_ibx_no_backup_locks; opt_decompress = opt_ibx_decompress; There is no effort to maintain it at all(I think this is because there is almost no difference between innobackupex and mariabackup options, and because nobody use innobackupex, and we don't have related bug reports). And you are correct, we gain nothing in functionality too by removing it. It's just code clean-up task to get rid of copy-pasted code. And if we really need the compatibility with innobackupex, we can keep it.

            If indeed "nobody use innobackupex", then we'd better remove this 1K lines of code.

            serg Sergei Golubchik added a comment - If indeed "nobody use innobackupex", then we'd better remove this 1K lines of code.
            szepeviktor Viktor Szépe added a comment - - edited

            Please consider adding a "timestamp" option to normal mode, so users are not forced to use

            date --utc "+%F_%H-%M-%S"
            

            to generate a sub-directory name.
            Thank you.

            szepeviktor Viktor Szépe added a comment - - edited Please consider adding a "timestamp" option to normal mode, so users are not forced to use date --utc "+%F_%H-%M-%S" to generate a sub-directory name. Thank you.

            People

              Unassigned Unassigned
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              1 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.