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

MTR creates nested links when tests are run with --mem

    Details

      Description

      Compare behavior in MySQL 5.5, MariaDB 5.5.41 and MariaDB 5.5.42:

      MySQL 5.5

      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ ls -l | grep var
      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ 
      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ ls -l /dev/shm/ | grep var
      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ 
      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ perl ./mtr main.1st --mem
      Logging: ./mtr  main.1st --mem
      MySQL Version 5.5.42
      ...
      Creating var directory '/data/repo/git/mysql-5.5/mysql-test/var'...
       - symlinking 'var' to '/dev/shm/var_auto_UXHl'
      ...
      Completed: All 1 tests were successful.
       
      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ ls -l | grep var
      lrwxrwxrwx  1 elenst disk     22 Feb 27 02:52 var -> /dev/shm/var_auto_UXHl
      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ ls -l /dev/shm/ | grep var
      drwxr-xr-x 8 elenst   disk          180 Feb 27 02:52 var_auto_UXHl
       
      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ perl ./mtr main.1st --mem
      Logging: ./mtr  main.1st --mem
      MySQL Version 5.5.42
      ...
      Creating var directory '/data/repo/git/mysql-5.5/mysql-test/var'...
       - symlinking 'var' to '/dev/shm/var_auto_uUQE'
      ...
      Completed: All 1 tests were successful.
       
      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ ls -l | grep var
      lrwxrwxrwx  1 elenst disk     22 Feb 27 02:52 var -> /dev/shm/var_auto_uUQE
      elenst@wheezy-64:~/git/mysql-5.5/mysql-test$ ls -l /dev/shm/ | grep var
      drwxr-xr-x 8 elenst   disk          180 Feb 27 02:52 var_auto_uUQE

      This is good behavior: a new folder in /dev/shm gets created, the old one gets removed, var points at the new one.

      MariaDB 5.5.41

      elenst@wheezy-64:/data/releases/mariadb-5.5.41-linux-x86_64/mysql-test$ ls -l | grep var
      elenst@wheezy-64:/data/releases/mariadb-5.5.41-linux-x86_64/mysql-test$ ls -l /dev/shm/ | grep var
      elenst@wheezy-64:/data/releases/mariadb-5.5.41-linux-x86_64/mysql-test$ perl ./mtr main.1st --mem
      Logging: ./mtr  main.1st --mem
      vardir: /data/releases/mariadb-5.5.41-linux-x86_64/mysql-test/var
      Removing old var directory...
      Creating var directory '/data/releases/mariadb-5.5.41-linux-x86_64/mysql-test/var'...
       - symlinking 'var' to '/dev/shm/var_auto_frKD'
      Checking supported features...
      ...
      Completed: All 1 tests were successful.
       
      elenst@wheezy-64:/data/releases/mariadb-5.5.41-linux-x86_64/mysql-test$ ls -l | grep var
      lrwxrwxrwx  1 elenst disk     22 Feb 27 02:56 var -> /dev/shm/var_auto_frKD
      elenst@wheezy-64:/data/releases/mariadb-5.5.41-linux-x86_64/mysql-test$ ls -l /dev/shm/ | grep var
      drwxr-xr-x 8 elenst   disk          180 Feb 27 02:56 var_auto_frKD
       
      elenst@wheezy-64:/data/releases/mariadb-5.5.41-linux-x86_64/mysql-test$ perl ./mtr main.1st --mem
      Logging: ./mtr  main.1st --mem
      vardir: /run/shm/var_auto_frKD
      Checking leftover processes...
      Removing old var directory...
      Creating var directory '/run/shm/var_auto_frKD'...
      Checking supported features...
      MariaDB Version 5.5.41-MariaDB
      ...
      Completed: All 1 tests were successful.
       
      elenst@wheezy-64:/data/releases/mariadb-5.5.41-linux-x86_64/mysql-test$ ls -l | grep var
      lrwxrwxrwx  1 elenst disk     22 Feb 27 02:56 var -> /dev/shm/var_auto_frKD
      elenst@wheezy-64:/data/releases/mariadb-5.5.41-linux-x86_64/mysql-test$ ls -l /dev/shm/ | grep var
      drwxr-xr-x 8 elenst   disk          180 Feb 27 02:56 var_auto_frKD
      drwx------ 2 elenst   disk           40 Feb 27 02:56 var_auto_nlxl

      It's bad behavior: a new folder gets created, the old one is kept, var points at the old one. Eventually there will be lots of folders in /dev/shm, but it's only marginally dangerous since they all will be empty.

      elenst@wheezy-64:~/git/5.5/mysql-test$ ls -l /dev/shm/ | grep var
      elenst@wheezy-64:~/git/5.5/mysql-test$ perl ./mtr 1st --mem
      Logging: ./mtr  1st --mem
      vardir: /data/repo/git/5.5/mysql-test/var
      Removing old var directory...
      Creating var directory '/data/repo/git/5.5/mysql-test/var'...
       - symlinking 'var' to '/dev/shm/var_auto_aE7b'
      Checking supported features...
      MariaDB Version 5.5.42-MariaDB-debug
      ...
      Completed: All 1 tests were successful.
       
      elenst@wheezy-64:~/git/5.5/mysql-test$ ls -l | grep var
      lrwxrwxrwx  1 elenst disk     22 Feb 27 02:59 var -> /dev/shm/var_auto_aE7b
      elenst@wheezy-64:~/git/5.5/mysql-test$ ls -l /dev/shm/ | grep var
      drwxr-xr-x 9 elenst   disk          200 Feb 27 02:59 var_auto_aE7b
       
      elenst@wheezy-64:~/git/5.5/mysql-test$ perl ./mtr 1st --mem
      Logging: ./mtr  1st --mem
      vardir: /run/shm/var_auto_aE7b
      Checking leftover processes...
      Removing old var directory...
      Creating var directory '/run/shm/var_auto_aE7b'...
       - symlinking 'var' to '/dev/shm/var_auto_Ex34'
      Checking supported features...
      MariaDB Version 5.5.42-MariaDB-debug
      ...
      Completed: All 1 tests were successful.
       
      elenst@wheezy-64:~/git/5.5/mysql-test$ ls -l | grep var
      lrwxrwxrwx  1 elenst disk     22 Feb 27 02:59 var -> /dev/shm/var_auto_aE7b
      elenst@wheezy-64:~/git/5.5/mysql-test$ ls -l /dev/shm/ | grep var
      lrwxrwxrwx 1 elenst   disk           22 Feb 27 02:59 var_auto_aE7b -> /dev/shm/var_auto_Ex34
      drwxr-xr-x 9 elenst   disk          200 Feb 27 02:59 var_auto_Ex34

      This is awful behavior: a new folder gets created, instead of the old folder a link with the same name points at the new folder, var points at the old folder (now a link). Soon enough the chain becomes too long and further tests refuse to run.

      At least the old behavior should be restored. Better still, it should work the way MySQL does.

        Attachments

          Activity

            People

            • Assignee:
              elenst Elena Stepanova
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: