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

mariadb-import --use-threads can kill its own connection instead of the other pooled connections

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • After multithreaded mariadb-import ends it error, it may fail to clean some remaining LOAD DATA jobs.

    Description

      When a worker fails in mariadb-import --use-threads=N, safe_exit() calls kill_tp_connections() to kill the other workers' connections, so the server does not keep loading after the client exits.

      It sends mysql_kill() for every connection over the failing worker's own connection, in list order. The failing worker's connection is in that list, so it can kill itself first. The following mysql_kill() calls then go over a dead connection and fail (the result is not checked), and the other workers are not killed. The client then calls _exit(), and the server is left running their LOAD DATA for a client that is gone.

      Seen intermittently in main.mysqldump (mariadb-import --use-threads=2 with a dropped table): the server logs "Aborted connection ... (Client disconnected)" for a worker that was still running LOAD DATA.

      Fix: kill the other connections first (skip own), then mysql_close() the own connection.

      Attachments

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              wlad Vladislav Vaintroub
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 3h
                  3h

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.