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
    • Resolution: Fixed
    • Major
    • 3.2.2
    • 3.2.1
    • 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

          For Gerrit Dashboard: CCBC-1478
          # Subject Branch Project Status CR V

          Activity

            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