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

mariadb-dump support for backup lock

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.18, 10.5.9, 10.6
    • 10.5, 10.6
    • Backup
    • None

    Description

      Some transactional backup can failed with Error 1412:Table definition has changed, thanks to the introduction of BACKUP STAGE MDEV-17309 this can be fix by introducing a new option
      --lock-for-backup

      that would for --single-transaction inject

      BACKUP STAGE START;
      BACKUP STAGE BLOCK_DDL;
      START TRANSACTION WITH CONSISTENT SNAPSHOT;

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            As mentioned in https://github.com/MariaDB/server/pull/2054, when doing a limited backup maybe BACKUP LOCK tbl is sufficient.

            monty is there a reason BACKUP LOCK tbls requires RELOAD privs? Would a table level privilege be sufficient? A SELECT statement in a transaction is sufficient to hold a metadata lock so couldn't that apply to {{BACKUP LOCK}}s too?

            danblack Daniel Black added a comment - As mentioned in https://github.com/MariaDB/server/pull/2054 , when doing a limited backup maybe BACKUP LOCK tbl is sufficient. monty is there a reason BACKUP LOCK tbls requires RELOAD privs? Would a table level privilege be sufficient? A SELECT statement in a transaction is sufficient to hold a metadata lock so couldn't that apply to {{BACKUP LOCK}}s too?
            monty Michael Widenius added a comment - - edited

            About RELOAD. The documentation is:
            "Execute FLUSH statements or equivalent mariadb-admin/mysqladmin commands."

            In effect having RELOAD privilege is not something that should cause any issues to give to anyone.
            It is more that anyone having RELOAD could potentially do a lot of not needed FLUSH commands, which could any people on busy server.
            Same thing with BACKUP STAGE as one can stop DDL's if one is not using it carefully.

            When it comes to BACKUP LOCK, having access to the table should probably be enough.
            I will check with Sergei.

            monty Michael Widenius added a comment - - edited About RELOAD. The documentation is: "Execute FLUSH statements or equivalent mariadb-admin/mysqladmin commands." In effect having RELOAD privilege is not something that should cause any issues to give to anyone. It is more that anyone having RELOAD could potentially do a lot of not needed FLUSH commands, which could any people on busy server. Same thing with BACKUP STAGE as one can stop DDL's if one is not using it carefully. When it comes to BACKUP LOCK, having access to the table should probably be enough. I will check with Sergei.

            The conclusion would be to allow one to do a BACKUP LOCK if one has either the global RELOAD privilege or the LOCK privilege on the table.
            This makes BACKUP LOCK similar to LOCK TABLE, but still backward compatible

            monty Michael Widenius added a comment - The conclusion would be to allow one to do a BACKUP LOCK if one has either the global RELOAD privilege or the LOCK privilege on the table. This makes BACKUP LOCK similar to LOCK TABLE, but still backward compatible

            mydumper patch on his way: https://github.com/mydumper/mydumper/issues/8 with some documented case

            stephane@skysql.com VAROQUI Stephane added a comment - mydumper patch on his way: https://github.com/mydumper/mydumper/issues/8 with some documented case
            danblack Daniel Black added a comment -

            Agree that making an additional privilege in addition to RELOAD is the easiest compatible way.

            LOCK_TABLES_ACL appears to be a database level privilege, which in addition to SELECT on the table give access to LOCK TABLE, so that pattern can be copied.

            Which major version should this change target?

            danblack Daniel Black added a comment - Agree that making an additional privilege in addition to RELOAD is the easiest compatible way. LOCK_TABLES_ACL appears to be a database level privilege, which in addition to SELECT on the table give access to LOCK TABLE, so that pattern can be copied. Which major version should this change target?

            People

              thiru Thirunarayanan Balathandayuthapani
              stephane@skysql.com VAROQUI Stephane
              Votes:
              1 Vote for this issue
              Watchers:
              5 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.