Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1478

Query timeout using read only when no results found

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.1
    • 3.2.2
    • library
    • None
    • 1
    • SDK34: CB++, OBO, Connect Prep, SDK36: Connect Prep/Recording

    Description

      The linked JSCBC-908 is marked as resolved however I can still reproduce the issue. The issue is in lcb. It retries the request when read only is true and 0 results are returned.

      To reproduce with a real cluster
       

      TEST_F(QueryUnitTest, testReadOnlyWithNoResults)
      {
          lcb_INSTANCE *instance;
          HandleWrap hw;
          if (!createClusterQueryConnection(hw, &instance)) {
              SKIP_CLUSTER_QUERY_TEST();
          }
          N1QLResult res;
          std::string query = "SELECT * from " + MockEnvironment::getInstance()->getBucket() + " limit 0";
          makeCommand(query.c_str());
          lcb_cmdquery_readonly(cmd, 1);
          lcb_cmdquery_timeout(cmd, LCB_MS2US(3000));
          lcb_STATUS rc = lcb_query(instance, &res, cmd);
          ASSERT_STATUS_EQ(LCB_SUCCESS, rc);
          lcb_wait(instance, LCB_WAIT_DEFAULT);
          ASSERT_STATUS_EQ(LCB_SUCCESS, res.rc);
          ASSERT_EQ(0, res.rows.size());
      }
      

      Expected equality of these values:
      LCB_SUCCESS
      Which is: 0
      actual_code__181
      Which is: 201
      LCB_SUCCESS (0) != LCB_ERR_TIMEOUT (201)

       

      Remove lcb_cmdquery_readonly(cmd, 1); and the test passes

      Attachments

        Issue Links

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

          Activity

            Build couchbase-server-7.1.0-1450 contains libcouchbase commit 92edf6d with commit message:
            CCBC-1478: skip test for older servers

            build-team Couchbase Build Team added a comment - Build couchbase-server-7.1.0-1450 contains libcouchbase commit 92edf6d with commit message: CCBC-1478 : skip test for older servers

            Build couchbase-server-7.1.0-1450 contains libcouchbase commit ca01550 with commit message:
            CCBC-1478: do not retry successful query with empty result

            build-team Couchbase Build Team added a comment - Build couchbase-server-7.1.0-1450 contains libcouchbase commit ca01550 with commit message: CCBC-1478 : do not retry successful query with empty result

            People

              avsej Sergey Avseyev
              jake.rawsthorne#1 Jake Rawsthorne [X] (Inactive)
              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