[MDEV-24909] JSON functions don't respect KILL QUERY / max_statement_time limit Created: 2021-02-17 Updated: 2022-05-31 Resolved: 2022-01-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.6.6 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | affects-tests | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
Some JSON functions, like JSON_MERGE, can be very lengthy if they are applied to long documents with many keys/values. Currently, if it happens, it is impossible to interrupt them – even killed or timed out, they still proceed to the end. The example below imitates merging two JSON documents, with 2000 key/value pairs in each. It takes ~25 seconds on a debug build, ~8 seconds on a release build. One can calculate how long it would take with 10,000 pairs in each of 2 documents, or with more documents to merge. The effect of a non-killable statement is that the server cannot be shut down normally.
From a different connection while SELECT continues running after max_statement_time:
|
| Comments |
| Comment by Elena Stepanova [ 2021-07-01 ] | ||||||||||||||||||||||||||||||||||||
|
Some other JSON functions which don't respect max_statement_time (which most likely means they don't obey KILL QUERY either):
| ||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-07-02 ] | ||||||||||||||||||||||||||||||||||||
|
https://github.com/MariaDB/server/commit/d194dbe434562dfe0619c474c0b5be37a51751fb | ||||||||||||||||||||||||||||||||||||
| Comment by Brad Smith [ 2021-07-07 ] | ||||||||||||||||||||||||||||||||||||
|
This commit... https://github.com/MariaDB/server/commit/add782a13e58c027c14d548fa705f48fc25cc3e1 does not build.
Which is this chunk of code..
| ||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-07-07 ] | ||||||||||||||||||||||||||||||||||||
|
It's a wrong MDEV for this. But anyway, what compiler was it? It was in the latest 10.6.3 release, so it has definitely compiled with a bunch of different gcc's and few clang's. With -Werror too. Although the line is wrong and should be fixed, I'd still rather prefer our CI's to catch compilation errors before the release. | ||||||||||||||||||||||||||||||||||||
| Comment by Brad Smith [ 2021-07-07 ] | ||||||||||||||||||||||||||||||||||||
|
Oh sorry I saw an MDEV in a commit branch at the bottom so I figured that was associated with the commit. Clang 11.1.0. | ||||||||||||||||||||||||||||||||||||
| Comment by Alexey Botchkov [ 2021-08-02 ] | ||||||||||||||||||||||||||||||||||||
|
The 'code cleanup' patches are ok. |