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

mysql_install_db complains about missed table mysql.gtid_slave_pos when started with option log-bin

Details

    Description

      If someone has option log-bin in their default configuration file mysql_install_db prints warning "2020-09-03 16:37:13 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")", although having such a table is not expected before mysql_install_db run.

      How to Repeat.

      $ ./scripts/mysql_install_db --no-defaults --basedir=. --datadir=./data --log-bin=master 
      Installing MariaDB/MySQL system tables in './data' ...
      2020-09-03 16:37:13 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
      OK
      ...
      Consider joining MariaDB's strong and vibrant community:
      https://mariadb.org/get-involved/
      

      Suggested Fix

      Ignore log-bin option in --bootstrap mode.

      Attachments

        Activity

          danblack Daniel Black added a comment -

          Thanks for the bug report and suggested fix. I'll take a look at it.

          danblack Daniel Black added a comment - Thanks for the bug report and suggested fix. I'll take a look at it.

          Ignoring intentionally configured binary logging to avoid an apparently harmless warning seems to be quite a radical fix. We should assume that at least some users know what they are doing when they have binary logging enabled upon bootstrap, and this change would not leave them any option to do so.

          elenst Elena Stepanova added a comment - Ignoring intentionally configured binary logging to avoid an apparently harmless warning seems to be quite a radical fix. We should assume that at least some users know what they are doing when they have binary logging enabled upon bootstrap, and this change would not leave them any option to do so.
          pgnd pgnd added a comment -

          rm'ing

          log-bin = /var/log/mariadb/mariadb-bin
          log-bin-index = /var/log/mariadb/mariadb-bin.index
          binlog_format = mixed

          from my config does, in fact, remove the 'warning'.

          > ... apparently harmless warning ...

          so, what's the resolution here?

          simply IGNORE the "[Warning]" if using log-bin in install/bootstrap mode?
          or is the intent to fix the warning?

          pgnd pgnd added a comment - rm'ing log-bin = /var/log/mariadb/mariadb-bin log-bin-index = /var/log/mariadb/mariadb-bin.index binlog_format = mixed from my config does, in fact, remove the 'warning'. > ... apparently harmless warning ... so, what's the resolution here? simply IGNORE the " [Warning] " if using log-bin in install/bootstrap mode? or is the intent to fix the warning?

          if adding --disable-log-bin to the mysqld command line in mysql_install_db will do the trick, then it could be a rather simple way to avoid the warning.

          serg Sergei Golubchik added a comment - if adding --disable-log-bin to the mysqld command line in mysql_install_db will do the trick, then it could be a rather simple way to avoid the warning.

          Yes, it should do the trick, and it's better than unconditionally disabling it for any --bootstrap.
          If somebody runs a custom bootstrap with log-bin enabled, and it indeed can't find the system table, I think warning is valid.
          Also, if the --disable-log-bin is added to the mysqld command line in mysql_install_db before explicit command-line options provided by the user, it leaves the possibility to run the script with binary logging, should anyone want to do so (although I can't really imagine why, unlike running a custom bootstrap).

          elenst Elena Stepanova added a comment - Yes, it should do the trick, and it's better than unconditionally disabling it for any --bootstrap . If somebody runs a custom bootstrap with log-bin enabled, and it indeed can't find the system table, I think warning is valid. Also, if the --disable-log-bin is added to the mysqld command line in mysql_install_db before explicit command-line options provided by the user, it leaves the possibility to run the script with binary logging, should anyone want to do so (although I can't really imagine why, unlike running a custom bootstrap).

          People

            danblack Daniel Black
            svetasmirnova Sveta Smirnova
            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.