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

[ADVISOR] stop session twice results in purge session advise

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.2
    • Fix Version/s: Neo
    • Component/s: query
    • Labels:
      None
    • Triage:
      Untriaged
    • Story Points:
      1
    • Is this a Regression?:
      Unknown

      Description

      To repro:

      • setup single node cluster
      • load travel-sample
      • run following advisor session:
        • SELECT ADVISOR({'action':'start', 'duration':'40m'})
        • SELECT airportname FROM `travel-sample` WHERE type = "airport" AND lower(city) = "lyon" AND country = "France";
        • select advisor({'action':'list'});
        • select advisor({'action':'stop', 'session':'18a0a2d5-9750-4245-8415-447bff9c1322'}); – replace with your session-id
        • select advisor({'action':'list'}) or select advisor({'action':'get', 'session':'18a0a2d5-9750-4245-8415-447bff9c1322'});
        • select advisor({'action':'stop', 'session':'18a0a2d5-9750-4245-8415-447bff9c1322'}); – replace with your session-id
        • select advisor({'action':'list'}) or select advisor({'action':'get', 'session':'18a0a2d5-9750-4245-8415-447bff9c1322'});

      with the second stop the session info is purge:

      cbq> SELECT ADVISOR({'action':'start', 'duration':'40m'});
      {
          "requestID": "36d73f82-f3ad-46c3-8a03-6016226d8002",
          "signature": {
              "$1": "object"
          },
          "results": [
          {
              "$1": {
                  "session": "3a4fed89-dfc7-45de-bec6-dcb871ea1872"
              }
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "57.073321ms",
              "executionTime": "56.853251ms",
              "resultCount": 1,
              "resultSize": 95,
              "serviceLoad": 6
          }
      }
      cbq> SELECT airportname FROM `travel-sample` WHERE type = "airport" AND lower(city) = "grenoble" AND country = "France";
      {
          "requestID": "f046d9ee-adc5-47f6-8eff-2fcc53166c32",
          "signature": {
              "airportname": "json"
          },
          "results": [
          {
              "airportname": "Saint Geoirs"
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "200.804783ms",
              "executionTime": "200.634758ms",
              "resultCount": 1,
              "resultSize": 45,
              "serviceLoad": 6
          }
      }
      cbq> SELECT airportname FROM `travel-sample` WHERE type = "airport" AND lower(city) = "grenoble" AND country = "France";
      {
          "requestID": "76f39e03-1511-4804-9bd0-08c5dcd2c93d",
          "signature": {
              "airportname": "json"
          },
          "results": [
          {
              "airportname": "Saint Geoirs"
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "203.78489ms",
              "executionTime": "203.573043ms",
              "resultCount": 1,
              "resultSize": 45,
              "serviceLoad": 6
          }
      }
      cbq> select advisor({'action':'list'});
      {
          "requestID": "ceeddeff-0d82-4ab2-be5d-02fc5e3e840d",
          "signature": {
              "$1": "object"
          },
          "results": [
          {
              "$1": [
                  {
                      "tasks_cache": {
                          "class": "advisor",
                          "delay": "40m0s",
                          "id": "2642f330-302c-5584-a1d0-2b1b1e93c087",
                          "name": "3a4fed89-dfc7-45de-bec6-dcb871ea1872",
                          "node": "127.0.0.1:8091",
                          "state": "scheduled",
                          "subClass": "analyze",
                          "submitTime": "2021-09-23 09:19:41.001258043 -0700 PDT m=+89016.116967643"
                      }
                  }
              ]
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "65.815681ms",
              "executionTime": "65.57651ms",
              "resultCount": 1,
              "resultSize": 550,
              "serviceLoad": 6
          }
      }
      cbq> select advisor({'action':'stop', 'session':'3a4fed89-dfc7-45de-bec6-dcb871ea1872'});
      {
          "requestID": "452df6f2-142e-4e51-9276-546405ad2873",
          "signature": {
              "$1": "object"
          },
          "results": [
          {
              "$1": []
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "2.103951238s",
              "executionTime": "2.10377042s",
              "resultCount": 1,
              "resultSize": 24,
              "serviceLoad": 6
          }
      }
      cbq> select advisor({'action':'list'});{
          "requestID": "46df8c38-a760-4cbb-b01d-de4de1e164ac",
          "signature": {
              "$1": "object"
          },
          "results": [
          {
              "$1": [
                  {
                      "tasks_cache": {
                          "class": "advisor",
                          "delay": "40m0s",
                          "id": "2642f330-302c-5584-a1d0-2b1b1e93c087",
                          "name": "3a4fed89-dfc7-45de-bec6-dcb871ea1872",
                          "node": "127.0.0.1:8091",
                          "results": [
                              {
                                  "current_used_indexes": [
                                      {
                                          "index": "CREATE INDEX def_type ON `travel-sample`(`type`)",
                                          "statements": [
                                              {
                                                  "run_count": 2,
                                                  "statement": "SELECT airportname FROM `travel-sample` WHERE type = \"airport\" AND lower(city) = \"grenoble\" AND country = \"France\";"
                                              }
                                          ]
                                      },
                                      {
                                          "index": "CREATE INDEX def_city ON `travel-sample`(`city`)",
                                          "statements": [
                                              {
                                                  "run_count": 2,
                                                  "statement": "SELECT airportname FROM `travel-sample` WHERE type = \"airport\" AND lower(city) = \"grenoble\" AND country = \"France\";"
                                              }
                                          ]
                                      }
                                  ],
                                  "recommended_covering_indexes": [
                                      {
                                          "index": "CREATE INDEX adv_country_lower_city_type_airportname ON `travel-sample`(`country`,lower(`city`),`airportname`) WHERE `type` = 'airport'",
                                          "statements": [
                                              {
                                                  "run_count": 2,
                                                  "statement": "SELECT airportname FROM `travel-sample` WHERE type = \"airport\" AND lower(city) = \"grenoble\" AND country = \"France\";"
                                              }
                                          ]
                                      }
                                  ],
                                  "recommended_indexes": [
                                      {
                                          "index": "CREATE INDEX adv_country_lower_city_type ON `travel-sample`(`country`,lower(`city`)) WHERE `type` = 'airport'",
                                          "statements": [
                                              {
                                                  "run_count": 2,
                                                  "statement": "SELECT airportname FROM `travel-sample` WHERE type = \"airport\" AND lower(city) = \"grenoble\" AND country = \"France\";"
                                              }
                                          ]
                                      }
                                  ]
                              }
                          ],
                          "state": "cancelled",
                          "subClass": "analyze",
                          "submitTime": "2021-09-23 09:19:41.001258043 -0700 PDT m=+89016.116967643"
                      }
                  }
              ]
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "102.200607ms",
              "executionTime": "102.054954ms",
              "resultCount": 1,
              "resultSize": 3388,
              "serviceLoad": 6
          }
      }
      cbq> select advisor({'action':'stop', 'session':'3a4fed89-dfc7-45de-bec6-dcb871ea1872'});
      {
          "requestID": "c7f7dcf0-9acd-4d57-b0f4-ad7c8263de0a",
          "signature": {
              "$1": "object"
          },
          "results": [
          {
              "$1": []
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "79.208689ms",
              "executionTime": "79.03128ms",
              "resultCount": 1,
              "resultSize": 24,
              "serviceLoad": 6
          }
      }
      cbq> select advisor({'action':'list'});{
          "requestID": "750f7c8c-2e0e-4271-bb84-c262298d8e77",
          "signature": {
              "$1": "object"
          },
          "results": [
          {
              "$1": []
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "50.194271ms",
              "executionTime": "49.972624ms",
              "resultCount": 1,
              "resultSize": 24,
              "serviceLoad": 6
          }
      }
       

      MB-48563 could be related to this as in the case of using raw ipv6 address we see task listed twice for the same session (ip and [ip]) and stop might in effect purge the session similar to running it twice

       

        Attachments

          Issue Links

          For Gerrit Dashboard: MB-48576
          # Subject Branch Project Status CR V

            Activity

            Hide
            build-team Couchbase Build Team added a comment -

            Build couchbase-server-7.1.0-1352 contains query commit bbae616 with commit message:
            MB-48576 Advisor() stop action shouldn't purge results

            Show
            build-team Couchbase Build Team added a comment - Build couchbase-server-7.1.0-1352 contains query commit bbae616 with commit message: MB-48576 Advisor() stop action shouldn't purge results
            Hide
            build-team Couchbase Build Team added a comment -

            Build couchbase-server-7.1.0-1362 contains query commit 0e89c4e with commit message:
            MB-48576 Adjust test cases.

            Show
            build-team Couchbase Build Team added a comment - Build couchbase-server-7.1.0-1362 contains query commit 0e89c4e with commit message: MB-48576 Adjust test cases.
            Hide
            pierre.regazzoni Pierre Regazzoni added a comment -

            Verified on 7.1.0-1362. Also updated TC to perform double stop.

            Show
            pierre.regazzoni Pierre Regazzoni added a comment - Verified on 7.1.0-1362. Also updated TC to perform double stop.

              People

              Assignee:
              pierre.regazzoni Pierre Regazzoni
              Reporter:
              pierre.regazzoni Pierre Regazzoni
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    PagerDuty