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

ignore-db-dir=lost+found not working

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.0.17
    • N/A
    • OTHER
    • None

    Description

      Have ignore-db-dir = 'lost+found' in my.cnf
      It is recognized:
      show global variables like 'ignore_db_dirs';

      Variable_name Value
      ignore_db_dirs lost+found

      But lost+found is not hidden

      show databases like "lost+found";

      Database (lost+found)
      lost+found

      Worked correctly in version 5.5.38

      Attachments

        Issue Links

          Activity

            Hi,

            Please note that ignore_db_dirs refer to the directory name, as opposed to the database name, and the difference is important here.

            From your output, it looks like you previously ran
            create database `lost+found`, and not
            mkdir <datadir>/lost+found.

            If you look into your datadir, you'll see that the existing directory is not lost+found, it's something like lost@002bfound. It gets converted back when you run show databases.

            It works the same way in 5.5.38 and 10.0, see output from 5.5.38 below.

            MariaDB [test]> select @@version;
            +----------------+
            | @@version      |
            +----------------+
            | 5.5.38-MariaDB |
            +----------------+
            1 row in set (0.00 sec)
             
            MariaDB [test]> select @@ignore_db_dirs;
            +------------------+
            | @@ignore_db_dirs |
            +------------------+
            | lost+found       |
            +------------------+
            1 row in set (0.00 sec)
             
            MariaDB [test]> select @@datadir;
            +--------------------------------------------------+
            | @@datadir                                        |
            +--------------------------------------------------+
            | /data/releases/mariadb-5.5.38-linux-x86_64/data/ |
            +--------------------------------------------------+
            1 row in set (0.00 sec)

            MariaDB [test]> system ls /data/releases/mariadb-5.5.38-linux-x86_64/data/
            aria_log.00000001  aria_log_control  ibdata1  ib_logfile0  ib_logfile1	mysql  performance_schema  test  wheezy-64.err	wheezy-64.pid
             
            MariaDB [test]> system mkdir /data/releases/mariadb-5.5.38-linux-x86_64/data/lost+found
             
            MariaDB [test]> system ls /data/releases/mariadb-5.5.38-linux-x86_64/data/
            aria_log.00000001  aria_log_control  ibdata1  ib_logfile0  ib_logfile1	lost+found  mysql  performance_schema  test  wheezy-64.err  wheezy-64.pid
             
            MariaDB [test]> show databases like "lost+found";
            Empty set (0.00 sec)

            MariaDB [test]> create database `lost+found`;
            Query OK, 1 row affected (0.00 sec)
             
            MariaDB [test]> system ls /data/releases/mariadb-5.5.38-linux-x86_64/data/
            aria_log.00000001  ibdata1	ib_logfile1	lost+found  performance_schema	wheezy-64.err
            aria_log_control   ib_logfile0	lost@002bfound	mysql	    test		wheezy-64.pid
             
            MariaDB [test]> show databases like "lost+found";
            +-----------------------+
            | Database (lost+found) |
            +-----------------------+
            | lost+found            |
            +-----------------------+
            1 row in set (0.00 sec)

            elenst Elena Stepanova added a comment - Hi, Please note that ignore_db_dirs refer to the directory name, as opposed to the database name, and the difference is important here. From your output, it looks like you previously ran create database `lost+found` , and not mkdir <datadir>/lost+found . If you look into your datadir, you'll see that the existing directory is not lost+found , it's something like lost@002bfound . It gets converted back when you run show databases . It works the same way in 5.5.38 and 10.0, see output from 5.5.38 below. MariaDB [test]> select @@version; + ----------------+ | @@version | + ----------------+ | 5.5.38-MariaDB | + ----------------+ 1 row in set (0.00 sec)   MariaDB [test]> select @@ignore_db_dirs; + ------------------+ | @@ignore_db_dirs | + ------------------+ | lost+found | + ------------------+ 1 row in set (0.00 sec)   MariaDB [test]> select @@datadir; + --------------------------------------------------+ | @@datadir | + --------------------------------------------------+ | /data/releases/mariadb-5.5.38-linux-x86_64/data/ | + --------------------------------------------------+ 1 row in set (0.00 sec) MariaDB [test]> system ls /data/releases/mariadb-5.5.38-linux-x86_64/data/ aria_log.00000001 aria_log_control ibdata1 ib_logfile0 ib_logfile1 mysql performance_schema test wheezy-64.err wheezy-64.pid   MariaDB [test]> system mkdir /data/releases/mariadb-5.5.38-linux-x86_64/data/lost+found   MariaDB [test]> system ls /data/releases/mariadb-5.5.38-linux-x86_64/data/ aria_log.00000001 aria_log_control ibdata1 ib_logfile0 ib_logfile1 lost+found mysql performance_schema test wheezy-64.err wheezy-64.pid   MariaDB [test]> show databases like "lost+found" ; Empty set (0.00 sec) MariaDB [test]> create database `lost+found`; Query OK, 1 row affected (0.00 sec)   MariaDB [test]> system ls /data/releases/mariadb-5.5.38-linux-x86_64/data/ aria_log.00000001 ibdata1 ib_logfile1 lost+found performance_schema wheezy-64.err aria_log_control ib_logfile0 lost@002bfound mysql test wheezy-64.pid   MariaDB [test]> show databases like "lost+found" ; + -----------------------+ | Database (lost+found) | + -----------------------+ | lost+found | + -----------------------+ 1 row in set (0.00 sec)
            ainsley31415926 Ainsley added a comment -

            Thank you, you were correct.
            'lost@002bfound' was created by a raw data directory copy from one data dir to another.

            ainsley31415926 Ainsley added a comment - Thank you, you were correct. 'lost@002bfound' was created by a raw data directory copy from one data dir to another.

            In this case it works as expected, closing a 'Not a bug'.
            Please feel free to comment if you disagree.

            elenst Elena Stepanova added a comment - In this case it works as expected, closing a 'Not a bug'. Please feel free to comment if you disagree.
            drupal drupal_user added a comment -

            There seems to be a bug, though. I mounted /var/lib/mysql on a separate partition before installing
            mysql-server. After installing: I have /var/lib/mysql mounted as its own ext4 filesystem.

            By default, the filesystem has a directory at its root named
            lost+found, which is used for cleanup during bad filesystem checks.

            When i install mysql-server, it mangles this directory (which doesn't
            really belong to it) into "lost@002bfound", and changes ownership on
            it to mysql:mysql:

            ls -l /var/lib/mysql/

            rw-rr- 1 root root 0 Nov 8 11:34 debian-5.1.flag
            rw-rw--- 1 mysql mysql 10485760 Nov 8 11:35 ibdata1
            rw-rw--- 1 mysql mysql 5242880 Nov 8 11:35 ib_logfile0
            rw-rw--- 1 mysql mysql 5242880 Nov 8 11:34 ib_logfile1
            drwx------ 2 mysql mysql 4096 Nov 8 11:35 lost@002bfound
            drwx------ 2 mysql root 4096 Nov 8 11:35 mysql
            rw------ 1 root root 6 Nov 8 11:35 mysql_upgrade_info
            0 stylus:~#

            Note the wrong permission lost@002bfound directory. It also now has a
            db.opt file inside it.

            I'm not sure how to repair this? What should I do with the db.opt file?

            I already looked at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608938

            drupal drupal_user added a comment - There seems to be a bug, though. I mounted /var/lib/mysql on a separate partition before installing mysql-server. After installing: I have /var/lib/mysql mounted as its own ext4 filesystem. By default, the filesystem has a directory at its root named lost+found, which is used for cleanup during bad filesystem checks. When i install mysql-server, it mangles this directory (which doesn't really belong to it) into "lost@002bfound", and changes ownership on it to mysql:mysql: ls -l /var/lib/mysql/ rw-r r - 1 root root 0 Nov 8 11:34 debian-5.1.flag rw-rw --- 1 mysql mysql 10485760 Nov 8 11:35 ibdata1 rw-rw --- 1 mysql mysql 5242880 Nov 8 11:35 ib_logfile0 rw-rw --- 1 mysql mysql 5242880 Nov 8 11:34 ib_logfile1 drwx------ 2 mysql mysql 4096 Nov 8 11:35 lost@002bfound drwx------ 2 mysql root 4096 Nov 8 11:35 mysql rw ------ 1 root root 6 Nov 8 11:35 mysql_upgrade_info 0 stylus:~# Note the wrong permission lost@002bfound directory. It also now has a db.opt file inside it. I'm not sure how to repair this? What should I do with the db.opt file? I already looked at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608938

            People

              elenst Elena Stepanova
              ainsley31415926 Ainsley
              Votes:
              0 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.