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

Server auto-sets lower_case_file_system value based on default datadir's behavior

Details

    Description

      When SST is unable to write to the datadir, it logs this warning:

      2019-08-21 15:25:02 0 [Warning] Can't create test file /var/lib/mysql/cs04r-sc-serv-99.lower-test
      

      ...even when the datadir has been configured to something other than /var/lib/mysql/.

      Attachments

        Activity

          Can you provide error log from the joiner ?

          jplindst Jan Lindström (Inactive) added a comment - Can you provide error log from the joiner ?
          karll Karl Levik added a comment -

          This issue originally came from me.

          Afraid I don't have the error log now. I actually didn't see an .err file in the data dir on the joiner while this was ongoing. (I did look for one!) I think I got the above warning from "systemctl status mariadb" or journalctl.

          karll Karl Levik added a comment - This issue originally came from me. Afraid I don't have the error log now. I actually didn't see an .err file in the data dir on the joiner while this was ongoing. (I did look for one!) I think I got the above warning from "systemctl status mariadb" or journalctl.

          I think this works as designed when it can't write the datadir it will select the default location.

          jplindst Jan Lindström (Inactive) added a comment - I think this works as designed when it can't write the datadir it will select the default location.
          karll Karl Levik added a comment -

          That seems rather confusing. Why would it try to write to the datadir specified in the .cnf files, and if it can't write there, then report that it can't write to the default datadir? Why not simply report that it couldn't write where it actually tried to write?

          karll Karl Levik added a comment - That seems rather confusing. Why would it try to write to the datadir specified in the .cnf files, and if it can't write there, then report that it can't write to the default datadir? Why not simply report that it couldn't write where it actually tried to write?
          juan.vera Juan added a comment -

          Hi jplindst,

          The error is that the log warning is reporting the wrong directory. Even if the server does try the default data directory after failing a test write on the configured data directory, it should log that it was unable to write to the configured data directory.

          juan.vera Juan added a comment - Hi jplindst , The error is that the log warning is reporting the wrong directory. Even if the server does try the default data directory after failing a test write on the configured data directory, it should log that it was unable to write to the configured data directory.

          This problem does not look specific to Galera. It looks the problem is here:

          https://github.com/MariaDB/server/blob/mariadb-10.1.43/sql/mysqld.cc#L4541

          It is performing the check with the value mysql_real_data_home, which refers to the path of the default datadir:

            SYSVAR_AUTOSIZE(lower_case_file_system,
                            test_if_case_insensitive(mysql_real_data_home));
          

          I believe that it should actually be performing the check with the value of mysql_real_data_home_ptr, which refers to the path of the actual datadir. e.g.:

            SYSVAR_AUTOSIZE(lower_case_file_system,
                            test_if_case_insensitive(mysql_real_data_home_ptr));
          

          GeoffMontee Geoff Montee (Inactive) added a comment - This problem does not look specific to Galera. It looks the problem is here: https://github.com/MariaDB/server/blob/mariadb-10.1.43/sql/mysqld.cc#L4541 It is performing the check with the value mysql_real_data_home , which refers to the path of the default datadir : SYSVAR_AUTOSIZE(lower_case_file_system, test_if_case_insensitive(mysql_real_data_home)); I believe that it should actually be performing the check with the value of mysql_real_data_home_ptr , which refers to the path of the actual datadir . e.g.: SYSVAR_AUTOSIZE(lower_case_file_system, test_if_case_insensitive(mysql_real_data_home_ptr));

          A check has been added for a variable indicating a user value (instead of default), plus the corresponding option has been parsed at an early stage, plus a check for its absence has been added: https://github.com/MariaDB/server/commit/93dea7da8302f2518b70175d3d4d8075b878f545

          sysprg Julius Goryavsky added a comment - A check has been added for a variable indicating a user value (instead of default), plus the corresponding option has been parsed at an early stage, plus a check for its absence has been added: https://github.com/MariaDB/server/commit/93dea7da8302f2518b70175d3d4d8075b878f545
          sysprg Julius Goryavsky added a comment - Fixed, https://github.com/MariaDB/server/commit/93dea7da8302f2518b70175d3d4d8075b878f545

          People

            sysprg Julius Goryavsky
            juan.vera Juan
            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.