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

Semi-sync Primary Segfaults on Net Error

    XMLWordPrintable

Details

    Description

      With the merge of MDEV-32365 into bb-10.6-semisync, the reporting of a net error results in a segfault. This is because the slave object is deleted, and then it is referenced for its server_id when reporting the error. See the following code snippet:

              else if (net.last_errno == ER_NET_READ_ERROR)
              {
                it.remove();
                if (net.last_errno > 0 && global_system_variables.log_warnings > 2)
                  sql_print_warning("Semisync ack receiver got error %d \"%s\" "
                                    "from slave server-id %d",
                                    net.last_errno, ER_DEFAULT(net.last_errno),
                                    slave->server_id());
              }
      

      The statement it.remove(); should happen after the warning is issued.

      Also, with the merge, the error log can report 3 separate messages when a slave disconnects, which seems potentially annoying/confusing for users:

      2023-12-06 14:30:21 10 [Warning] Semisync ack receiver got error 1158 "Got an error reading communication packets" from slave server-id 2
      2023-12-06 14:30:21 45 [Warning] Aborted connection 44 to db: 'unconnected' user: 'root' host: 'localhost' (KILLED)
      2023-12-06 14:30:21 44 [Note] Stop semi-sync binlog_dump to slave (server_id: 2)
      

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              bnestere Brandon Nesterenko
              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.