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

monitoring node elimination does not work with node_name() because functions are never pushed down in scans

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.0.0
    • 5.0.0
    • query
    • Untriaged
    • Unknown

    Description

       Using node_name() as a filter for monitoring queries results in a span error

      cbq> select * from system:completed_requests where node=node_name();
      {
          "requestID": "4fe21e82-3b4e-4611-a976-1718c30ef346",
          "signature": {
              "*": "*"
          },
          "results": [
          ],
          "errors": [
              {
                  "code": 11000,
                  "msg": "System datastore error Invalid seek value \u003cnil\u003e of type \u003cnil\u003e."
              }
          ],
          "status": "errors",
          "metrics": {
              "elapsedTime": "1.52136ms",
              "executionTime": "1.507283ms",
              "resultCount": 0,
              "resultSize": 0,
              "errorCount": 1
          }
      }
      

      because rather than the function, the plan includes a son with a null lower bound

      cbq> explain select * from system:completed_requests where node=node_name();
      {
          "requestID": "62e3190f-70cb-4cd0-872e-96d818387b1d",
          "signature": "json",
          "results": [
              {
                  "plan": {
                      "#operator": "Sequence",
                      "~children": [
                          {
                              "#operator": "IndexScan",
                              "index": "#nodes",
                              "index_id": "#nodes",
                              "keyspace": "completed_requests",
                              "namespace": "#system",
                              "spans": [
                                  {
                                      "Range": {
                                          "Inclusion": 0,
                                          "Low": [
                                              "null"
                                          ]
                                      }
                                  }
                              ],
                              "using": "system"
                          },
                          {
                              "#operator": "Fetch",
                              "keyspace": "completed_requests",
                              "namespace": "#system"
                          },
                          {
                              "#operator": "Parallel",
                              "~child": {
                                  "#operator": "Sequence",
                                  "~children": [
                                      {
                                          "#operator": "Filter",
                                          "condition": "((`completed_requests`.`node`) = node_name())"
                                      },
                                      {
                                          "#operator": "InitialProject",
                                          "result_terms": [
                                              {
                                                  "expr": "self",
                                                  "star": true
                                              }
                                          ]
                                      },
                                      {
                                          "#operator": "FinalProject"
                                      }
                                  ]
                              }
                          }
                      ]
                  },
                  "text": "select * from system:completed_requests where node=node_name();"
              }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "3.057404ms",
              "executionTime": "3.000776ms",
              "resultCount": 1,
              "resultSize": 2200
          }
      }
      

       

      Attachments

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

        Activity

          People

            ajay.bhullar Ajay Bhullar
            marco.greco Marco Greco (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty