-
Type:
Bug
-
Resolution: Unresolved
-
None
-
Affects Version/s: None
-
Component/s: Editor general
-
High
-
In very seldom cases a DB index may get corrupt. An automatic recognition and repair mechanism is implemented.
-
Emptyshow more show less
problem
In very seldom cases it happens that DB indices are getting corrupted:
{"message":"Internal Server Error","errorMessage":"SQLSTATE[HY000]:
General error: 1712 Index Zf_worker is corrupted, query was: UPDATE
Zf_worker u, ( SELECT w.id
AS id, @num := if(@wworker = w.worker, @num:= @num + 1, 1) AS count,
@wworker := w.worker as worker, w.maxParallelProcesses AS max, w.state
AS staten FROM Zf_worker w, (SELECT @wworker := utf8mb4 '' COLLATE utf8mb4_unicode_ci, @num := 0) rn WHERE w.state = ? /* BINDING 0 _/
Since depending on the affected table that brings down the whole application. The problem can be fixed easily with an optimize table statement. Though it must be invoked manually at the moment.
solution
- Parse the DB error message in a very low level place
- If its a corrupted index schedule the rebuild of that index (optimize table TABLE)
- The mechanism must ensure that a table is not optimized multiple times at the same time - since multiple parallel HTTP requests may recognize the problem
- An error should be logged, so that are informed
Please create a small concept first.