Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-59922

E_TASK_RUNNING error is returned but ignored by caller.

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      Deleting"running" task entry is not allowed and error is returned.

      But the error is ignored by the callers (
      tasksCacheKeyspace.Delete() ,doTask, and "purge"/"abort" session ) this leads to the wrong assumption that the task is deleted.

       

      This can happen when analyzeworkload()-Advisor function or updateindexstats()-CREATE/CREATE PRIMARY/BUILD  have prolonged execution times.

       

      Repro:

      simulate by adding sleep in source https://github.com/couchbase/query/blob/master/scheduler/scheduler.go#L172 

      > CREATE INDEX idx1 ON default(a)

      > GET http://127.0.0.1:9499/admin/tasks_cache

      [
         

      {         "class": "update_statistics",         "delay": "1s",         "description": "default:default._default._default(idx100)",         "id": "8a636221-d867-55b3-883b-a7ec83af9efa",         "name": "46453fd4-64c6-4dd0-82ff-72768b509c0e",         "queryContext": "",         "startTime": "2023-12-01T14:01:11.773+05:30",         "state": "running",         "subClass": "create_index",         "submitTime": "2023-12-01T14:01:10.773+05:30"     }

      ]

       

      > DELETE /admin/tasks_cache/46453fd4-64c6-4dd0-82ff-72768b509c0e 

      true

       

      > DELETE FROM system:tasks_cache WHERE name="46453fd4-64c6-4dd0-82ff-72768b509c0e";

      {

          "requestID": "67d8d9e6-13cf-42b3-817a-952a9b5b7eab",

          "signature": null,

          "results": [

          ],

          "status": "success",

          "metrics":

      {         "elapsedTime": "1.382542ms",         "executionTime": "1.307167ms",         "resultCount": 0,         "resultSize": 0,         "serviceLoad": 2,         "mutationCount": 1     }

      }

       

      But the task entry is never actually deleted

      >  SELECT * FROM system:tasks_cache;

      {

          "requestID": "aba613dd-0243-4ef9-a19b-6a42f14c31e8",

          "signature":

      {         "*": "*"     }

      ,

          "results": [

          {

              "tasks_cache":

      {             "class": "update_statistics",             "delay": "1s",             "description": "default:default._default._default(idx100)",             "id": "8a636221-d867-55b3-883b-a7ec83af9efa",             "name": "46453fd4-64c6-4dd0-82ff-72768b509c0e",             "node": "172.16.1.174:9000",             "queryContext": "",             "startTime": "2023-12-01T14:01:11.773+05:30",             "state": "running",             "subClass": "create_index",             "submitTime": "2023-12-01T14:01:10.773+05:30"         }

          }

          ]

       
       
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            gaurav.jayaraj Gaurav Jayaraj
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty