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

Allow innodb_undo_tablespaces to be changed after database creation

    XMLWordPrintable

Details

    Description

      To change the number of undo tablespaces, we need to reinitialize the data directory (dump + restore).
      InnoDB should allow changing number of undo tablespaces as a part of restart process.
      System tablespace contains InnoDB dictionary tables, doublewrite buffer, change buffer tree
      and undo log pages. By allowing this change, InnoDB can reduce the workload on system tablespace.

      Requirements

      A prior shutdown with SET GLOBAL innodb_fast_shutdown=0 must be executed before adding the undo log tablespaces.

      This is because the undo logs must be empty (no incomplete or XA PREPARE transactions, nothing to be purged) so that the old undo tablespaces can discarded and new ones created.

      Steps

      1. Check whether the existing undo log exists. If exists then give the warnings about the slow shutdown and start the server normally.
      2. If not exist then free the system tablespace rollback segment header page else throw message about slow shutdown and continue the normal server start operation
      3. Free the system tablespace rollback segment header page of the slots 1...127
      4. Reset the TRX_SYS page and reinitialize the system tablespace rollback segment slot(0th slot), doublewrite information,
        update the binlog info and WSREP info in system rollback segment header page (0th slot page)
        Step(3) and (4) should happen within a single mini-transaction
      5. Delete the old undo tablespaces if any
      6. Make checkpoint to get rid of old undo tablespace redo log records
      7. Read the latest MAX_SPACE_ID from dictionary header page
      8. Create the new specified undo log tablespace and initialize the page0 of all undo tablespaces
        Step (7) and Step (8) should happen within a single mini-transaction
      9. Make the checkpoint again to make sure that next startup or backup reads the undo log tablespaces before
        opening the redo log records
      10. Create the rollback segment for each rollback segment in a round robin fashion

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              thiru Thirunarayanan Balathandayuthapani
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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