Details
-
Type:
Task
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Fix Version/s: 10.2
-
Component/s: None
-
Labels: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.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Since this task was filed, the architecture of SHOW EXPLAIN has changed: now, every query produces an "Explain data structure" which can be grabbed from another thread without much difficulty (compare that to the old design where SHOW EXPLAIN walked actual execution structures, e.g. JOINs, JOIN_TABs, quick selects, etc). Because of that, we might want to modify SHOW EXPLAIN code to produce EXPLAIN output in the other thread directly, without using the APC mechanism. This will leave KILL to be the only user of the APC.