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

Error in read_log_event() corrupts relay log writer, crashes server

Details

    Description

      This bug is also seen as a sporadic failure/crash in rpl.rpl_from_mysql80.

      When read_log_event() gets an error reading an event, it sets file->error=-1:

          /*
            The SQL slave thread will check if file->error<0 to know
            if there was an I/O error. Even if there is no "low-level" I/O errors
            with 'file', any of the high-level above errors is worrying
            enough to stop the SQL thread now ; as we are skipping the current event,
            going on with reading and successfully executing other events can
            only corrupt the slave's databases. So stop.
          */
          file->error= -1;
      

      But this is wrong, the file can be the "hot" relaylog that is simultaneously being written by the IO thread, so the file->error flag is shared with that thread. Setting it can cause the IO thread to wrongly detect a write error and disable the relay log. There was then also a missing test for disabled relay log in CHANGE MASTER which could crash on nullptr.

      Attachments

        Activity

          Monty said he would do the review, re-assigning

          knielsen Kristian Nielsen added a comment - Monty said he would do the review, re-assigning
          Elkin Andrei Elkin added a comment -

          knielsen, anyway I looked through to understand and appreciate the idea and solution, still with a question.

          Elkin Andrei Elkin added a comment - knielsen , anyway I looked through to understand and appreciate the idea and solution, still with a question .

          Pushed to 10.6

          knielsen Kristian Nielsen added a comment - Pushed to 10.6

          People

            monty Michael Widenius
            knielsen Kristian Nielsen
            Votes:
            1 Vote for this issue
            Watchers:
            4 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.