Automatic handle and repair corrupt index problems

XMLWordPrintable

    • 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.

      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

      1. Parse the DB error message in a very low level place
      2. If its a corrupted index schedule the rebuild of that index (optimize table TABLE)
      3. 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
      4. An error should be logged, so that are informed

      Please create a small concept first.

            Assignee:
            Thomas Lauria
            Reporter:
            Thomas Lauria
            Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: