Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-4796

8.0 DD and atomic DDL breaks DROP DATABASE for engines that store files in database directory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 8.0
    • Fix Version/s: None
    • Component/s: TokuDB
    • Labels:
      None

      Description

      Introduced in this upstream commit https://github.com/mysql/mysql-server/commit/6fbedeb605c0225c72b3ca4c48365c6376f2a2a6

       

      Consider the following SQL :

       

      CREATE DATABASE test;
      CREATE TABLE test.t1(a INT PRIMARY KEY) ENGINE=TOKUDB;
      DROP DATABASE test;
      ERROR 1010 (HY000): Error dropping database (can't rmdir './test/', errno: 17 - File exists)
      $ ls -la data/test/
      total 60
      drwxr-x--- 2 glorch glorch 4096 Aug 30 09:37 ./
      drwxr-x--- 8 glorch glorch 4096 Aug 30 09:37 ../
      -rw-r----- 1 glorch glorch 1753 Aug 30 09:37 t1_369.sdi
      -rw-r----- 1 glorch glorch 32768 Aug 30 09:37 t1_main_2_3_1d.tokudb
      -rw-r----- 1 glorch glorch 16384 Aug 30 09:37 t1_status_2_1_1d.tokudb
      

       

      The TokuDB engine has the option (enabled by default) to store its index files within the mysql database directory of the database where the table was created.  In 5.7, when the DROP DATABASE logic within sql/sql_db.cc:find_unknown_and_remove_deletable_files function found extra files that it did not know how to handle, it fell back to enumerating the tables within the database and performing 'friendly' or formal deletion of each table within the database.  The commit noted above for 8.0 breaks/changes this and now the server simply spits an error to the client.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                george.lorch George Lorch
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 45 minutes
                  45m