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

MariaDB fails to start without galera_recovery in systemd mode

Details

    Description

      We compile our own MariaDB packages, and all galera and wsrep files have been separated into a subpackage along with its dependencies and configuration files.

      After upgrading from 10.1.14 to 10.1.16, mariadb server fails to start due to missing the galera_recovery script. From what I can gather in the systemd configuration, it could/should check for the existance of galera_recovery before attempting to run it.

      As a workaround I could include the script in the server subpackage, but I am uncertain whether that would actually work since it might just error out due to other missing wsrep/galera files.

      The cleanest way I think would be to only run the script if it exists, and otherwise assume galera is not activated. Possibly check for some other file(s) as well and return a warning if galera is present such that it can be activated but the recovery script is missing.

      Attachments

        Issue Links

          Activity

            Dead2 Hans Kristian Rosbach created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Assignee Nirbhay Choubey [ nirbhay_c ]
            Dead2 Hans Kristian Rosbach added a comment - - edited

            We are using the following patch as a temporary workaround. It has the side-effect that it causes _WSREP_START_POSITION to be set even though galera_recovery did not exist and thus was not run. It is a bit ugly, but whether it can actually cause a real problem, I do not know.

            --- old/support-files/mariadb.service.in    2016-07-14 03:10:31.000000000 +0200
            +++ new/support-files/mariadb.service.in    2016-08-11 10:19:18.421000000 +0200
            @@ -63,7 +63,7 @@
             # the script is not expected to return with a non-zero status.
             # It is always safe to unset _WSREP_START_POSITION environment variable.
             ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
            -ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && \
            +ExecStartPre=/bin/sh -c "[ -e /usr/bin/galera_recovery ] && VAR=`/usr/bin/galera_recovery` || exit 0; [ $? -eq 0 ] && \
              systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
             
             # Needed to create system tables etc.
            

            Dead2 Hans Kristian Rosbach added a comment - - edited We are using the following patch as a temporary workaround. It has the side-effect that it causes _WSREP_START_POSITION to be set even though galera_recovery did not exist and thus was not run. It is a bit ugly, but whether it can actually cause a real problem, I do not know. --- old/support-files/mariadb.service.in 2016-07-14 03:10:31.000000000 +0200 +++ new/support-files/mariadb.service.in 2016-08-11 10:19:18.421000000 +0200 @@ -63,7 +63,7 @@ # the script is not expected to return with a non-zero status. # It is always safe to unset _WSREP_START_POSITION environment variable. ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" -ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && \ +ExecStartPre=/bin/sh -c "[ -e /usr/bin/galera_recovery ] && VAR=`/usr/bin/galera_recovery` || exit 0; [ $? -eq 0 ] && \ systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1" # Needed to create system tables etc.
            nirbhay_c Nirbhay Choubey (Inactive) made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            nirbhay_c Nirbhay Choubey (Inactive) made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            nirbhay_c Nirbhay Choubey (Inactive) added a comment - http://lists.askmonty.org/pipermail/commits/2016-August/009682.html
            nirbhay_c Nirbhay Choubey (Inactive) made changes -
            Assignee Nirbhay Choubey [ nirbhay_c ] Sergey Vojtovich [ svoj ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            svoj Sergey Vojtovich made changes -
            Assignee Sergey Vojtovich [ svoj ] Nirbhay Choubey [ nirbhay_c ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            nirbhay_c Nirbhay Choubey (Inactive) made changes -
            Component/s Scripts & Clients [ 11002 ]
            Fix Version/s 10.1.17 [ 22102 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            nirbhay_c Nirbhay Choubey (Inactive) made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 76627 ] MariaDB v4 [ 150743 ]

            People

              nirbhay_c Nirbhay Choubey (Inactive)
              Dead2 Hans Kristian Rosbach
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.