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

Fix flushing of non-ACID tables in BACKUP SERVER

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 13.2
    • N/A
    • Server
    • None

    Description

      To prevent copying torn files during backup, they need to be flushed. This is needed for non-ACID engine files (CSV, MyISAM etc.) and non-transactional Aria files. The method of calling tc_purge() and tdc_purge(true), which is what happens in the MDEV-14992 tree, is insufficient. This only closes tables that are not "in use": although the backup lock prevents them for being in use by any writers, they can also be held open in use for reading by a read-only query. And while being open for reading is completely compatible with flushing (but not closing the table or purging it from the cache), in this implementation it does not happen.

      This can be solved by instead calling the flush_tables() function, which in addition to purging selectively flushes in-use tables.

      An additional complication here is that the locking rules for non-user (system) tables differ from those for user tables: they can still be written to in BACKUP_PHASE_NO_DDL. This in particular affects stats tables, which are non-transactional Aria tables.

      This can be solved by copying system tables in BACKUP_PHASE_NO_COMMIT, where they can no longer be written, and ensuring they are also flushed at the beginning of this phase.

      Attachments

        Issue Links

          Activity

            People

              andrzej.jarzabek Andrzej Jarzabek
              andrzej.jarzabek Andrzej Jarzabek
              Andrzej Jarzabek Andrzej Jarzabek
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1d 4.6h Original Estimate - 1d 4.6h
                  1d 4.6h
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 8d
                  8d

                  Git Integration

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