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

mariadb service won't shutdown when it's running and the OS datetime updated backwards

Details

    Description

      When I update the OS datetime *backwards* while `mariadb` is running, it causes `mariadb` to hang when I command it's service to stop.
      I've also noticed that this doesn't occur when I set the new OS datetime value to be grater than the current OS datetime, only backwards causes the hang.

      Steps to reproduce:

       
          sudo date --set="2018-10-04 20:00:00"
       
          sudo service mysql start
           * Starting MariaDB database server mysqld [ OK ]
       
          sudo service mysql stop
           * Stopping MariaDB database server mysqld [ OK ]
       
          sudo service mysql start
           * Starting MariaDB database server mysqld [ OK ]
       
          sudo date --set="2018-10-04 10:00:00"
       
          sudo service mysql stop
           * Stopping MariaDB database server mysqld
      
      

      > setting the date, starting the service, resetting the date -10 hours, stopping the service => hang

      Attachments

        Issue Links

          Activity

            wlad, what do you think of this hack? Basically, we would intentionally trigger some ‘spurious wakeups’ to work around the problem. Ultimately we want to rewrite the page cleaner (MDEV-16526) and get rid of the problematic call, but that would be a way too big change in GA releases.

            marko Marko Mäkelä added a comment - wlad , what do you think of this hack? Basically, we would intentionally trigger some ‘spurious wakeups’ to work around the problem. Ultimately we want to rewrite the page cleaner ( MDEV-16526 ) and get rid of the problematic call, but that would be a way too big change in GA releases.
            wlad Vladislav Vaintroub added a comment - - edited

            waking at shutdown seems fine, but do we really need it at other times, frequently? buf_flush_event is set here and there anyway, in different situations.

            wlad Vladislav Vaintroub added a comment - - edited waking at shutdown seems fine, but do we really need it at other times, frequently? buf_flush_event is set here and there anyway, in different situations.

            https://jira.mariadb.org/browse/MDEV-17481?focusedCommentId=133652&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-133652
            probably causes a regression, because it uses nanoseconds timer my_interval_timer(), where previously milliseconds were used.

            ulint next_loop_time = ut_time_ms() + 1000; vs ulint next_loop_time = my_interval_timer() + 1000;

            is a big difference.

            wlad Vladislav Vaintroub added a comment - https://jira.mariadb.org/browse/MDEV-17481?focusedCommentId=133652&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-133652 probably causes a regression, because it uses nanoseconds timer my_interval_timer(), where previously milliseconds were used. ulint next_loop_time = ut_time_ms() + 1000; vs ulint next_loop_time = my_interval_timer() + 1000; is a big difference.

            wlad, the old comment that you refer to is not part of the currently planned solution. We would not increase the use of my_interval_timer(), but instead basically just ensure that a call to os_event_set(buf_flush_event) will end the infinite wait here and there.

            marko Marko Mäkelä added a comment - wlad , the old comment that you refer to is not part of the currently planned solution. We would not increase the use of my_interval_timer() , but instead basically just ensure that a call to os_event_set(buf_flush_event) will end the infinite wait here and there.

            The work-around looks OK to me. We’d be waking up the page cleaner in logs_empty_and_mark_files_at_shutdown() and srv_master_do_idle_tasks().

            marko Marko Mäkelä added a comment - The work-around looks OK to me. We’d be waking up the page cleaner in logs_empty_and_mark_files_at_shutdown() and srv_master_do_idle_tasks() .

            People

              thiru Thirunarayanan Balathandayuthapani
              jossef Jossef Harush
              Votes:
              0 Vote for this issue
              Watchers:
              11 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.