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

[BP MB-36929] - Set a valid clientContextId on eventing queries

    XMLWordPrintable

    Details

    • Triage:
      Untriaged
    • Is this a Regression?:
      Unknown

      Description

      We should set a clientContextId on queries originating from eventing to some helpful default, such as handler_name.line:doc_id for mutation initiated queries, and handler_name.line:timer_reference in case of timer initiated queries. This will assist in debugging issues that may happen via N1QL tools.

        Attachments

          Issue Links

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

            Activity

            Hide
            jeelan.poola Jeelan Poola added a comment -

            Till WestmannRitam Sharma We need to back port this to 6.6.0 as many customers have requested this so that they can identify slow performing queries from eventing JS code. Fix is simple, adds a default clinet-context-id to every N1QL query fired from eventing. We have also run perf runs to ensure there is no regression.

            Job: http://perf.jenkins.couchbase.com/view/Eventing/job/themis-dev/1019/
            The test result for the n1ql is as follows:
            Test run : Functions executed/sec, 1 bucket x 20M x 1KB, 4KV + 1Eventing node, single function-N1QL
            |     Build          |      Throughput      |
            | 6.6.0-7661   |       17153              |
            | 6.6.0- 7692  |       17118              |
            | toy build       |       16650               |
            Toy build : 6.6.0-11237
            

            Request adding this to 6.6.0. Thank you!

            Show
            jeelan.poola Jeelan Poola added a comment - Till Westmann Ritam Sharma We need to back port this to 6.6.0 as many customers have requested this so that they can identify slow performing queries from eventing JS code. Fix is simple, adds a default clinet-context-id to every N1QL query fired from eventing. We have also run perf runs to ensure there is no regression. Job: http://perf.jenkins.couchbase.com/view/Eventing/job/themis-dev/1019/ The test result for the n1ql is as follows: Test run : Functions executed/sec, 1 bucket x 20M x 1KB, 4KV + 1Eventing node, single function-N1QL | Build | Throughput | | 6.6.0-7661 | 17153 | | 6.6.0- 7692 | 17118 | | toy build | 16650 | Toy build : 6.6.0-11237 Request adding this to 6.6.0. Thank you!
            Hide
            ritam.sharma Ritam Sharma added a comment -

            Jeelan Poola - This can be added for 6.6.

            Show
            ritam.sharma Ritam Sharma added a comment - Jeelan Poola - This can be added for 6.6.
            Hide
            jeelan.poola Jeelan Poola added a comment -

            Thank you Ritam Sharma!

            Show
            jeelan.poola Jeelan Poola added a comment - Thank you Ritam Sharma !
            Hide
            build-team Couchbase Build Team added a comment -

            Build couchbase-server-6.6.0-7804 contains eventing commit b158da5 with commit message:
            MB-39874 : Ensure a useful clientContextId is set by default

            Show
            build-team Couchbase Build Team added a comment - Build couchbase-server-6.6.0-7804 contains eventing commit b158da5 with commit message: MB-39874 : Ensure a useful clientContextId is set by default
            Hide
            vikas.chaudhary Vikas Chaudhary added a comment -

            Verified on 6.6.0 build 7839

            clientContextID set in the n1ql client

             [
              {
                "completed_requests": {
                  "clientContextID": "5@n1ql.js(OnUpdate)",
                  "elapsedTime": "324.113µs",
                  "errorCount": 1,
                  "errors": [
                    {
                      "cause": "No index available on keyspace src_bucket that matches your query. Use CREATE INDEX or CREATE PRIMARY INDEX to create an index, or check that your expected index is online.",
                      "code": 4000,
                      "key": "plan_error",
                      "message": ""
                    }
                  ],
                  "node": "10.143.192.103:8091",
                  "phaseTimes": {
                    "parse": "198.454µs",
                    "plan": "45.882µs"
                  },
                  "remoteAddr": "10.143.192.102:50372",
                  "requestId": "521edb70-1e9d-4340-a8d1-840439c543d4",
                  "requestTime": "2020-06-24T02:40:09.61-07:00",
                  "resultCount": 0,
                  "resultSize": 0,
                  "scanConsistency": "unbounded",
                  "serviceTime": "279.937µs",
                  "state": "fatal",
                  "statement": "select * from src_bucket;",
                  "userAgent": "libcouchbase/2.10.6_1_ga77874d137 (Linux-4.15.0-66-generic; x86_64; GNU 7.3.0)",
                  "users": "@eventing"
                }
              },
              {
                "completed_requests": {
                  "clientContextID": "4@n1ql.js(OnUpdate)",
                  "elapsedTime": "2.481201ms",
                  "errorCount": 0,
                  "mutations": 1,
                  "node": "10.143.192.103:8091",
                  "phaseOperators": {
                    "authorize": 1,
                    "insert": 1
                  },
                  "phaseTimes": {
                    "authorize": "29.358µs",
                    "insert": "1.80381ms",
                    "instantiate": "17.627µs",
                    "parse": "470.61µs",
                    "plan": "21.45µs",
                    "run": "1.878414ms"
                  },
                  "remoteAddr": "10.143.192.102:50372",
                  "requestId": "f09810ea-ee5a-4ddc-a6b0-d538fecc0381",
                  "requestTime": "2020-06-24T02:40:09.604-07:00",
                  "resultCount": 0,
                  "resultSize": 0,
                  "scanConsistency": "unbounded",
                  "serviceTime": "2.401206ms",
                  "state": "completed",
                  "statement": "INSERT INTO dst_bucket ( KEY, VALUE ) VALUES ( $docId ,'Hello World');",
                  "userAgent": "libcouchbase/2.10.6_1_ga77874d137 (Linux-4.15.0-66-generic; x86_64; GNU 7.3.0)",
                  "users": "@eventing"
                }
              },
              {
                "completed_requests": {
                  "clientContextID": "4@n1ql.js(OnUpdate)",
                  "elapsedTime": "1.87764648s",
                  "errorCount": 0,
                  "mutations": 1,
                  "node": "10.143.192.103:8091",
                  "phaseOperators": {
                    "authorize": 1,
                    "insert": 1
                  },
                  "phaseTimes": {
                    "authorize": "31.349µs",
                    "insert": "766.896µs",
                    "instantiate": "23.792µs",
                    "parse": "904.951µs",
                    "plan": "1.186776ms",
                    "run": "848.061µs"
                  },
                  "remoteAddr": "10.143.192.102:50266",
                  "requestId": "30743e3f-733e-4b5b-8c07-777853090abe",
                  "requestTime": "2020-06-24T02:34:10.172-07:00",
                  "resultCount": 0,
                  "resultSize": 0,
                  "scanConsistency": "unbounded",
                  "serviceTime": "2.989193ms",
                  "state": "completed",
                  "statement": "INSERT INTO dst_bucket ( KEY, VALUE ) VALUES ( $docId ,'Hello World');",
                  "userAgent": "libcouchbase/2.10.6_1_ga77874d137 (Linux-4.15.0-66-generic; x86_64; GNU 7.3.0)",
                  "users": "@eventing"
                }
              }
            ]

            Show
            vikas.chaudhary Vikas Chaudhary added a comment - Verified on 6.6.0 build 7839 clientContextID set in the n1ql client [ { "completed_requests": { "clientContextID": "5@n1ql.js(OnUpdate)", "elapsedTime": "324.113µs", "errorCount": 1, "errors": [ { "cause": "No index available on keyspace src_bucket that matches your query. Use CREATE INDEX or CREATE PRIMARY INDEX to create an index, or check that your expected index is online.", "code": 4000, "key": "plan_error", "message": "" } ], "node": "10.143.192.103:8091", "phaseTimes": { "parse": "198.454µs", "plan": "45.882µs" }, "remoteAddr": "10.143.192.102:50372", "requestId": "521edb70-1e9d-4340-a8d1-840439c543d4", "requestTime": "2020-06-24T02:40:09.61-07:00", "resultCount": 0, "resultSize": 0, "scanConsistency": "unbounded", "serviceTime": "279.937µs", "state": "fatal", "statement": "select * from src_bucket;", "userAgent": "libcouchbase/2.10.6_1_ga77874d137 (Linux-4.15.0-66-generic; x86_64; GNU 7.3.0)", "users": "@eventing" } }, { "completed_requests": { "clientContextID": "4@n1ql.js(OnUpdate)", "elapsedTime": "2.481201ms", "errorCount": 0, "mutations": 1, "node": "10.143.192.103:8091", "phaseOperators": { "authorize": 1, "insert": 1 }, "phaseTimes": { "authorize": "29.358µs", "insert": "1.80381ms", "instantiate": "17.627µs", "parse": "470.61µs", "plan": "21.45µs", "run": "1.878414ms" }, "remoteAddr": "10.143.192.102:50372", "requestId": "f09810ea-ee5a-4ddc-a6b0-d538fecc0381", "requestTime": "2020-06-24T02:40:09.604-07:00", "resultCount": 0, "resultSize": 0, "scanConsistency": "unbounded", "serviceTime": "2.401206ms", "state": "completed", "statement": "INSERT INTO dst_bucket ( KEY, VALUE ) VALUES ( $docId ,'Hello World');", "userAgent": "libcouchbase/2.10.6_1_ga77874d137 (Linux-4.15.0-66-generic; x86_64; GNU 7.3.0)", "users": "@eventing" } }, { "completed_requests": { "clientContextID": "4@n1ql.js(OnUpdate)", "elapsedTime": "1.87764648s", "errorCount": 0, "mutations": 1, "node": "10.143.192.103:8091", "phaseOperators": { "authorize": 1, "insert": 1 }, "phaseTimes": { "authorize": "31.349µs", "insert": "766.896µs", "instantiate": "23.792µs", "parse": "904.951µs", "plan": "1.186776ms", "run": "848.061µs" }, "remoteAddr": "10.143.192.102:50266", "requestId": "30743e3f-733e-4b5b-8c07-777853090abe", "requestTime": "2020-06-24T02:34:10.172-07:00", "resultCount": 0, "resultSize": 0, "scanConsistency": "unbounded", "serviceTime": "2.989193ms", "state": "completed", "statement": "INSERT INTO dst_bucket ( KEY, VALUE ) VALUES ( $docId ,'Hello World');", "userAgent": "libcouchbase/2.10.6_1_ga77874d137 (Linux-4.15.0-66-generic; x86_64; GNU 7.3.0)", "users": "@eventing" } } ]

              People

              Assignee:
              siri Sriram Melkote (Inactive)
              Reporter:
              jeelan.poola Jeelan Poola
              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