[MDEV-442] Refactor KILL to work via APC Created: 2012-08-08 Updated: 2015-11-17 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This is based on review discussion for SHOW EXPLAIN: 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: 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. Additional taskCurrently, 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. |
| Comments |
| Comment by Sergei Petrunia [ 2015-01-28 ] |
|
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. |