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

Refactor KILL to work via APC

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      This is based on review discussion for SHOW EXPLAIN:
      https://lists.launchpad.net/maria-developers/msg04825.html

      The idea is to have KILL command to work via APC mechanism. (APC means Async Procedure Call, sql/my_apc.*, these are not Windows' APCs)

      The primary challenge is that KILL needs to work (and work instantly) in all cases:
      1. when the victim is sleeping on IO under Windows
      2. when the victim is idle.
      3. when the victim is a part of thread pool, is currently idle, and not using any CPU.

      Current KILL implementation works in all three by doing "destructive" actions. For example, it will close victim's network socket to wake it up from network IO-sleep.

      Generic APC mechanism cannot be destructive, so implementation of this task needs:

      1. Design a platform-independent non-destructive way to reliably wake up a thread from any state.
      2. Make both SHOW EXPLAIN and KILL use it.

      Additional task

      Currently, SHOW EXPLAIN makes calls to apc_target.enable() and apc_target.disable() to make sure that SHOW EXPLAIN request is not delivered to a thread that is unable to promptly serve it.
      When this task is finished, these calls can be removed in favor of checking whether EXPLAIN is available in the destination thread.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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