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

Multiple tables in one RENAME command can make mariabackup fail

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • mariabackup
    • None
    • Can result in data loss
    • Hide
      When a temp table is created, and another temp table is created from it then a enterprise backup is taken, a recovery can no longer work at all. The work around is simply not create a temp table or drop it as soon as possible, but SNOW in future releases can not do this per SNOW.
      Show
      When a temp table is created, and another temp table is created from it then a enterprise backup is taken, a recovery can no longer work at all. The work around is simply not create a temp table or drop it as soon as possible, but SNOW in future releases can not do this per SNOW.

    Description

      I was able to reproduce this problem with an extreme example, like this:

      RENAME TABLE MESSAGES to OLD_MESSAGES,
                  A_TMP_MESSAGES to MESSAGES,
                  B_TMP_MESSAGES to A_TMP_MESSAGES,
                  C_TMP_MESSAGES to B_TMP_MESSAGES,
                  D_TMP_MESSAGES to C_TMP_MESSAGES,
                  E_TMP_MESSAGES to D_TMP_MESSAGES,
                  F_TMP_MESSAGES to E_TMP_MESSAGES,
                  G_TMP_MESSAGES to F_TMP_MESSAGES,
                  H_TMP_MESSAGES to G_TMP_MESSAGES,
                  I_TMP_MESSAGES to H_TMP_MESSAGES,
                  J_TMP_MESSAGES to I_TMP_MESSAGES,
                  K_TMP_MESSAGES to J_TMP_MESSAGES,
                  L_TMP_MESSAGES to K_TMP_MESSAGES,
                  M_TMP_MESSAGES to L_TMP_MESSAGES,
                  N_TMP_MESSAGES to M_TMP_MESSAGES,
                  O_TMP_MESSAGES to N_TMP_MESSAGES,
                  P_TMP_MESSAGES to O_TMP_MESSAGES,
                  Q_TMP_MESSAGES to P_TMP_MESSAGES,
                  R_TMP_MESSAGES to Q_TMP_MESSAGES,
                  S_TMP_MESSAGES to R_TMP_MESSAGES,
                  T_TMP_MESSAGES to S_TMP_MESSAGES,
                  U_TMP_MESSAGES to T_TMP_MESSAGES,
                  V_TMP_MESSAGES to U_TMP_MESSAGES,
                  W_TMP_MESSAGES to V_TMP_MESSAGES,
                  X_TMP_MESSAGES to W_TMP_MESSAGES,
                  Y_TMP_MESSAGES to X_TMP_MESSAGES,
                  Z_TMP_MESSAGES to Y_TMP_MESSAGES;
      

      Note that one table relinquishes a name and another table takes that name, all in one command.

      Which produces the following error on backup:

      2026-02-24 16:27:05 0 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace: ./unificticio/D_TMP_MESSAGES#P#p2019#SP#p2019sp1.ibd uses space ID: 6140. Cannot open filepath: ./unificticio/C_TMP_MESSAGES#P#p2019#SP#p2019sp1.ibd which uses the same space ID.
      [00] FATAL ERROR: 2026-02-24 16:27:05 Failed to validate first page of the file unificticio/C_TMP_MESSAGES#P#p2019#SP#p2019sp1, error 40
      

      Customer got this error during `mariabackup --prepare` operation:

      Date-Time 0 [Note] InnoDB: At LSN: xxxxxxxxxxxx: unable to open file ./snow/tmp_s346969378g.idb for tablespace 12345.
      

      Workaround:
      If i run each rename one at a time with do sleep(1); between each command, there is no error if backing up at same time.

      Attachments

        Activity

          People

            Unassigned Unassigned
            edward Edward Stoever
            Votes:
            2 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.