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

Rename Table twice raise error "Tablespace is missing for a table"

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.5.7
    • N/A
    • None
    • Windows docker container only. Not Linux, not windows native

    Description

      From: https://github.com/docker-library/mariadb/issues/331

      Run docker-compose up -d
      connect with your favorite client (I'm using DBeaver Enterprise)
      Run a create table statement:

      CREATE TABLE NewTable (
      ID int primary key,
      name varchar(10)
      )

      Run a RENAME table statement like this:
      RENAME TABLE mytestdb.NewTable TO mytestdb.NewTablea;

      Then, run again, another RENAME the statement:
      RENAME TABLE mytestdb.NewTablea TO mytestdb.NewTableb;

      The error I'm getting is:
      SQL Error [1025] [HY000]: (conn=4) Error on rename of './mytestdb/newtablea' to './mytestdb/newtableb' (errno: 194 "Tablespace is missing for a table")

      Notes:
      1 - When I install the MariaDB client via .msi installer for windows, all works fine
      2 - I changed the variable lower_case_table_names to 1 because the default with windows is coming 2 for me, but with no success, the error still the same.
      3 - I created the same container with mysql:latest image instead of mariadb and all works fine
      4 - Tried to adjust folder permissions on windows, giving all permisions to anyone (like a chmod 777 on linux), but the erros still the same.

      So I think that there's some problem with windows + mariadb:latest image

      Attachments

        1. files.PNG
          9 kB
          Rafael Ambrosio
        2. ProcessMonitorLogfile.CSV
          7 kB
          Vladislav Vaintroub
        3. rename.c
          0.2 kB
          Daniel Black
        4. rename.strace
          0.9 kB
          Rafael Ambrosio
        5. rename-wsl.strace
          3 kB
          Rafael Ambrosio
        6. script.sql
          0.3 kB
          Vladislav Vaintroub
        7. strace.out
          23 kB
          Vladislav Vaintroub
        8. WSL Disabled - Working with Hyper-V.png
          39 kB
          Rafael Ambrosio

        Issue Links

          Activity

            Hi! Unfortunatelly, I don't have the environment anymore, neither the laptop. Since I started to have slowing down problems to work with docker on WSL, I decided to migrate to a real Linux environment. Sorry, but thanks for all the effort!

            ambrosiora Rafael Ambrosio added a comment - Hi! Unfortunatelly, I don't have the environment anymore, neither the laptop. Since I started to have slowing down problems to work with docker on WSL, I decided to migrate to a real Linux environment. Sorry, but thanks for all the effort!
            a_tschersich Andreas Tschersich added a comment - - edited

            The error is back with Windows 10 19044.2311.

            a_tschersich Andreas Tschersich added a comment - - edited The error is back with Windows 10 19044.2311.

            if so, maybe danblack can reopen https://github.com/microsoft/WSL/issues/8443 . it still remains a "not MariaDB bug"

            wlad Vladislav Vaintroub added a comment - if so, maybe danblack can reopen https://github.com/microsoft/WSL/issues/8443 . it still remains a "not MariaDB bug"
            Xiphoseer Daniel Seiler added a comment - - edited

            We had a user reproduce this issue on Win10 Pro 22H2, Docker Desktop + WSL2, MariaDB 1:11.2.2+maria~ubu2204, that is a migration failed with

            pymysql.err.OperationalError: (1025, 'Error on rename of \'./darkflame/accounts\' to \'./darkflame/#sql-backup-1-20\' (errno: 194 "Tablespace is missing for a table")')
            

            with a MariaDB log of

            [ERROR] InnoDB: Cannot rename './darkflame/accounts.ibd' to './darkflame/#sql-backup-1-20.ibd' because the source file does not exist.
            

            I'm commenting about it because the user reported that the reproducer in https://github.com/microsoft/WSL/issues/8443#issuecomment-1836812926 did not print any sort of "error on fstat errno 2", so while I think this it's still possible that MariaDB triggers some weird behaviour in 9P on Windows 10, it may be too quick to dismiss it as WSL#8443 and "not a MariaDB bug".

            Xiphoseer Daniel Seiler added a comment - - edited We had a user reproduce this issue on Win10 Pro 22H2, Docker Desktop + WSL2, MariaDB 1:11.2.2+maria~ubu2204, that is a migration failed with pymysql.err.OperationalError: (1025, 'Error on rename of \'./darkflame/accounts\' to \'./darkflame/#sql-backup-1-20\' (errno: 194 "Tablespace is missing for a table")') with a MariaDB log of [ERROR] InnoDB: Cannot rename './darkflame/accounts.ibd' to './darkflame/#sql-backup-1-20.ibd' because the source file does not exist. I'm commenting about it because the user reported that the reproducer in https://github.com/microsoft/WSL/issues/8443#issuecomment-1836812926 did not print any sort of "error on fstat errno 2", so while I think this it's still possible that MariaDB triggers some weird behaviour in 9P on Windows 10, it may be too quick to dismiss it as WSL#8443 and "not a MariaDB bug".
            danblack Daniel Black added a comment -

            Hi Xiphoseer,

            Sorry to here we've still got a new form of this. To validate the system calls used:

            • install strace in the container (new container with "FROM mariadb:11.2.2\nRUN apt-get update && apt-get install -y strace")
            • after initializing some data, before the rename, --user mysql --entrypoint "strace -s 99" --command mariadbd, then preform the rename. Like what wlad did above, use ProcessMonitor to cature the rename at the same time.
            • yes I'm the user that put the broken reproducer. I was missing while doing the tests, and it didn't show up even though it looks exactly like the strace conditions, nor the under the basic rename. If you can create a C file and create a reproducer image that works in your environment that would be much appreciated.

              Dockerfile

              ARG VERSION=22.04
              FROM ubuntu:$VERSION
               
              COPY wsl8443.c .
               
              RUN apt-get update && apt-get install -y gcc strace && rm -rf /var/lib/apt/lists/*
               
              RUN gcc -o wsl8443 wsl8443.c
              

            danblack Daniel Black added a comment - Hi Xiphoseer , Sorry to here we've still got a new form of this. To validate the system calls used: install strace in the container (new container with "FROM mariadb:11.2.2\nRUN apt-get update && apt-get install -y strace") after initializing some data, before the rename, --user mysql --entrypoint "strace -s 99" --command mariadbd, then preform the rename. Like what wlad did above, use ProcessMonitor to cature the rename at the same time. yes I'm the user that put the broken reproducer. I was missing while doing the tests, and it didn't show up even though it looks exactly like the strace conditions, nor the under the basic rename. If you can create a C file and create a reproducer image that works in your environment that would be much appreciated. Dockerfile ARG VERSION=22.04 FROM ubuntu:$VERSION   COPY wsl8443.c .   RUN apt-get update && apt-get install -y gcc strace && rm -rf /var/lib/apt/lists/*   RUN gcc -o wsl8443 wsl8443.c

            People

              danblack Daniel Black
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.