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

InnoDB: Failing assertion: (&log_sys->mutex)->is_owned() if server started with innodb-scrub-log

Details

    Description

      To reproduce,

      • start debug server on a clean datadir with innodb-scrub-log=on, otherwise defaults;
      • wait for a few seconds

      2017-01-02 17:22:54 0x7f5967ffc700  InnoDB: Assertion failure in file /data/src/10.2/storage/innobase/log/log0log.cc line 364
      InnoDB: Failing assertion: (&log_sys->mutex)->is_owned()
       
      #5  0x00007f59ab0b9448 in __GI_abort () at abort.c:89
      #6  0x00007f59ae268bae in ut_dbg_assertion_failed (expr=0x7f59ae758f87 "(&log_sys->mutex)->is_owned()", file=0x7f59ae758f58 "/data/src/10.2/storage/innobase/log/log0log.cc", line=364) at /data/src/10.2/storage/innobase/ut/ut0dbg.cc:59
      #7  0x00007f59ae0d30f0 in log_reserve_and_open (len=512) at /data/src/10.2/storage/innobase/log/log0log.cc:364
      #8  0x00007f59ae0d8cfb in log_pad_current_log_block () at /data/src/10.2/storage/innobase/log/log0log.cc:2543
      #9  0x00007f59ae0d8dd1 in log_scrub () at /data/src/10.2/storage/innobase/log/log0log.cc:2578
      #10 0x00007f59ae0d8e6d in log_scrub_thread (arg=0x0) at /data/src/10.2/storage/innobase/log/log0log.cc:2610
      #11 0x00007f59ad1be0a4 in start_thread (arg=0x7f5967ffc700) at pthread_create.c:309
      #12 0x00007f59ab16b87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      Attachments

        Activity

          elenst Elena Stepanova created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Assignee Marko Mäkelä [ marko ] Jan Lindström [ jplindst ]
          elenst Elena Stepanova made changes -
          Comment [ A comment with security level 'Developers' was removed. ]
          jplindst Jan Lindström (Inactive) made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          jplindst Jan Lindström (Inactive) added a comment - http://lists.askmonty.org/pipermail/commits/2017-January/010369.html
          jplindst Jan Lindström (Inactive) made changes -
          Assignee Jan Lindström [ jplindst ] Marko Mäkelä [ marko ]
          Status In Progress [ 3 ] In Review [ 10002 ]

          The patch looks otherwise OK to me, but in the test, I think that instead of SLEEP(5), we should use include/wait_condition.inc to wait that the counter is advancing. That would make the test run normally faster, and it would avoid random test failures in a loaded test environment where nothing might happen during the 5-second wait.

          marko Marko Mäkelä added a comment - The patch looks otherwise OK to me, but in the test, I think that instead of SLEEP(5), we should use include/wait_condition.inc to wait that the counter is advancing. That would make the test run normally faster, and it would avoid random test failures in a loaded test environment where nothing might happen during the 5-second wait.
          marko Marko Mäkelä made changes -
          Assignee Marko Mäkelä [ marko ] Jan Lindström [ jplindst ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          jplindst Jan Lindström (Inactive) made changes -
          Status Stalled [ 10000 ] In Progress [ 3 ]

          commit 403f6e96070a3f35745d4d59d12e222d21ac4f38
          Author: Jan Lindström <jan.lindstrom@mariadb.com>
          Date: Tue Jan 3 11:22:09 2017 +0200

          MDEV-11705: InnoDB: Failing assertion: (&log_sys->mutex)->is_owned() if server started with innodb-scrub-log

          Problem was that log_scrub function did not take required log_sys mutex.

          Background: Unused space in log blocks are padded with MLOG_DUMMY_RECORD if innodb-scrub-log
          is enabled. As log files are written on circular fashion old log blocks can be reused
          later for new redo-log entries. Scrubbing pads unused space in log blocks to avoid visibility
          of the possible old redo-log contents.

          log_scrub(): Take log_sys mutex

          log_pad_current_log_block(): Increase srv_stats.n_log_scrubs if padding is done.

          srv0srv.cc: Set srv_stats.n_log_scrubs to export vars innodb_scrub_log

          ha_innodb.cc: Export innodb_scrub_log to global status.

          jplindst Jan Lindström (Inactive) added a comment - commit 403f6e96070a3f35745d4d59d12e222d21ac4f38 Author: Jan Lindström <jan.lindstrom@mariadb.com> Date: Tue Jan 3 11:22:09 2017 +0200 MDEV-11705 : InnoDB: Failing assertion: (&log_sys->mutex)->is_owned() if server started with innodb-scrub-log Problem was that log_scrub function did not take required log_sys mutex. Background: Unused space in log blocks are padded with MLOG_DUMMY_RECORD if innodb-scrub-log is enabled. As log files are written on circular fashion old log blocks can be reused later for new redo-log entries. Scrubbing pads unused space in log blocks to avoid visibility of the possible old redo-log contents. log_scrub(): Take log_sys mutex log_pad_current_log_block(): Increase srv_stats.n_log_scrubs if padding is done. srv0srv.cc: Set srv_stats.n_log_scrubs to export vars innodb_scrub_log ha_innodb.cc: Export innodb_scrub_log to global status.
          jplindst Jan Lindström (Inactive) made changes -
          issue.field.resolutiondate 2017-01-03 09:30:43.0 2017-01-03 09:30:43.236
          jplindst Jan Lindström (Inactive) made changes -
          Fix Version/s 10.2.4 [ 22116 ]
          Fix Version/s 10.2 [ 14601 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 79047 ] MariaDB v4 [ 151472 ]

          People

            jplindst Jan Lindström (Inactive)
            elenst Elena Stepanova
            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.