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

Galera bootstrap (/etc/init.d/mysql bootstrap) returns code 0 on failure

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.14-galera, 10.0.15-galera
    • 5.5.41-galera, 10.0.16-galera
    • wsrep
    • None
    • CentOS 6 x86_64

    Description

      The /etc/init.d/mysql init script returns a 0 (indicating no error) code on failure when using the bootstrap argument, used for bootstrapping a Galera cluster.

      I observed this when I was running

      /etc/init.d/mysql bootstrap

      and

      /usr/bin/mysqld_safe --wsrep-recover

      at the same time

      To be clear, the bug here is not that it failed in my example, but that it failed and returned 0.

      [root@db01 ~]# /etc/init.d/mysql bootstrap
      Bootstrapping the clusterStarting MySQL...                 [FAILED]
      [root@db01 ~]# echo $?
      0

      This signals to other tools such as Puppet, Pacemaker or systemd that the MariaDB daemon is running ok while it isn't.

      Attachments

        Activity

          kenny_r Kenny Rasschaert created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Assignee Nirbhay Choubey [ nirbhay_c ]
          kenny_r Kenny Rasschaert added a comment - - edited

          A fix for this issue would be to append

          exit $?


          to this line.

          I don't know how to use bzr and going through the contribution guidelines seems overkill for adding one statement to a shell script. Can a regular contributor add this?

          kenny_r Kenny Rasschaert added a comment - - edited A fix for this issue would be to append exit $? to this line . I don't know how to use bzr and going through the contribution guidelines seems overkill for adding one statement to a shell script. Can a regular contributor add this?
          kenny_r Kenny Rasschaert made changes -
          Description I observed this command
          {code}/etc/init.d/mysql bootstrap{code}
          failing when I was running
          {code}/usr/bin/mysqld_safe --wsrep-recover{code}
          at the same time

          The same kan be observed when trying to bootstrap while running {code}/usr/bin/mysql start{code}
          at the same time.

          The bug here is not that it fails (it should), but that *it fails and returns 0*.
          {code}
          [root@db01 ~]# /etc/init.d/mysql bootstrap
          Bootstrapping the clusterStarting MySQL... [FAILED]
          [root@db01 ~]# echo $?
          0
          {code}

          This signals to other tools (in my case, Puppet) that the bootstrap did not fail.
          The /etc/init.d/mysql init script returns a 0 (indicating no error) code on failure when using the bootstrap argument, used for bootstrapping a Galera cluster.

          I observed this when I was running
          {code}/etc/init.d/mysql bootstrap{code}
          and
          {code}/usr/bin/mysqld_safe --wsrep-recover{code}
          at the same time

          To be clear, the bug here is not that it failed in my example, but that *it failed and returned 0*.
          {code}
          [root@db01 ~]# /etc/init.d/mysql bootstrap
          Bootstrapping the clusterStarting MySQL... [FAILED]
          [root@db01 ~]# echo $?
          0
          {code}

          This signals to other tools such as Puppet, Pacemaker or systemd that the MariaDB daemon is running ok while it isn't.
          Summary Galera bootstrap might fail with exit 0 if another mysql process is active. Galera bootstrap (/etc/init.d/mysql bootstrap) returns code 0 on failure
          nirbhay_c Nirbhay Choubey (Inactive) added a comment - http://bazaar.launchpad.net/~maria-captains/maria/maria-10.0-galera/revision/3908
          nirbhay_c Nirbhay Choubey (Inactive) made changes -
          Component/s Galera [ 10124 ]
          Fix Version/s 5.5.41-galera [ 17502 ]
          Fix Version/s 10.0.16-galera [ 18101 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          nirbhay_c Nirbhay Choubey (Inactive) made changes -
          Component/s wsrep [ 11500 ]
          Component/s Galera [ 10124 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 58953 ] MariaDB v3 [ 65623 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 65623 ] MariaDB v4 [ 148622 ]

          People

            nirbhay_c Nirbhay Choubey (Inactive)
            kenny_r Kenny Rasschaert
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.