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

AT_PLUS queries with collections are not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.0.2, 7.1.0
    • 7.0.0
    • query
    • Untriaged
    • 1
    • No

    Description

      SDK: Java 3.1.6

      Server Version: Couchbase Server 7.0.0-5274 (docker pull build-docker.couchbase.com:443/couchbase/server-internal:7.0.0-5274)

      I was trying to run this code snippet with the SDK, and got an `Internal Couchbase Server Error`:

      Collection collection = scope.collection("airport"); 
      MutationResult mr = collection.upsert("someDoc", JsonObject.create().put("name", "roi"));
      MutationState mutationState = MutationState.from(mr.mutationToken().get());
      QueryOptions qo = QueryOptions.queryOptions().consistentWith(mutationState); 
      QueryResult result = cluster.query("select raw meta().id from `travel-sample`.inventory.airport limit 100", qo); 

      I also tried with this and got the same result.

       QueryResult result = scope.query("select raw meta().id from airport limit 100", qo);

       

      NOTE: If I omit the query options with the mutation state it works fine in both cases:

       QueryResult result = cluster.query("select raw meta().id from `travel-sample`.inventory.airport limit 100");

        QueryResult result = scope.query("select raw meta().id from airport limit 100");

      Here is what I could see in the Couchbase Server `query` logs:

      2021-06-11T07:43:13.815-07:00 [Info] connected with 1 indexers
      2021-06-11T07:43:13.815-07:00 [Info] client stats current counts: current: 23, not current: 0
      2021-06-11T07:43:13.818-07:00 [Info] num concurrent scans {0}
      2021-06-11T07:43:13.818-07:00 [Info] average scan response {0 ms}
      2021-06-11T07:43:14.050-07:00 [Info] [Queryport-connpool:127.0.0.1:9101] active conns 0, free conns 1
      2021-06-11T07:43:44.308-07:00 [Info] GsiClient::UpdateUsecjson: using collatejson as data format between indexer and GsiClient
      2021-06-11T07:43:44.312-07:00 [Warn] scan failed: requestId cb817d44-03b7-456f-be61-1e5c7fadb063 queryport 127.0.0.1:9101 inst 6271999087344361358 partition [0]
      2021-06-11T07:43:44.312-07:00 [Warn] Scan failed with error for index 10531732614137662252.  Trying scan again with replica, reqId:cb817d44-03b7-456f-be61-1e5c7fadb063 :  queryport.expectedTimestamp from [127.0.0.1:9101] ...
      2021-06-11T07:43:44.312-07:00 [Error] PickRandom: Fail to find indexer for all index partitions. Num partition 1.  Partition with instances 0
      2021-06-11T07:43:44.312-07:00 [Warn] Fail to find indexers to satisfy query request.  Trying scan again for index 10531732614137662252, reqId:cb817d44-03b7-456f-be61-1e5c7fadb063 :  queryport.expectedTimestamp from [127.0.0.1:9101] ...
      2021-06-11T07:43:44.322-07:00 [Warn] scan failed: requestId cb817d44-03b7-456f-be61-1e5c7fadb063 queryport 127.0.0.1:9101 inst 6271999087344361358 partition [0]
      2021-06-11T07:43:44.322-07:00 [Warn] Scan failed with error for index 10531732614137662252.  Trying scan again with replica, reqId:cb817d44-03b7-456f-be61-1e5c7fadb063 :  queryport.expectedTimestamp from [127.0.0.1:9101] ...
      2021-06-11T07:43:44.322-07:00 [Error] PickRandom: Fail to find indexer for all index partitions. Num partition 1.  Partition with instances 0
      2021-06-11T07:43:44.322-07:00 [Warn] Fail to find indexers to satisfy query request.  Terminate scan for index 10531732614137662252,  reqId:cb817d44-03b7-456f-be61-1e5c7fadb063 :  queryport.expectedTimestamp from [127.0.0.1:9101]
      2021-06-11T07:44:13.745-07:00 [Info] connected with 1 indexers
      2021-06-11T07:44:13.745-07:00 [Info] client stats current counts: current: 23, not current: 0
      2021-06-11T07:44:13.749-07:00 [Info] num concurrent scans {0}
      2021-06-11T07:44:13.749-07:00 [Info] average scan response {0 ms}
      2021-06-11T07:44:14.000-07:00 [Info] [Queryport-connpool:127.0.0.1:9101] active conns 0, free conns 1
      2021-06-11T07:44:14.380-07:00 [Info] GSIC[default/travel-sample-inventory-airport-1623421935197912500] logstats "travel-sample" {"gsi_scan_count":1,"gsi_scan_duration":11041500,"gsi_throttle_duration":0,"gsi_prime_duration":0,"gsi_blocked_duration":0,"gsi_total_temp_files":0}
      2021-06-11T07:45:13.675-07:00 [Info] connected with 1 indexers
      2021-06-11T07:45:13.675-07:00 [Info] client stats current counts: current: 23, not current: 0
      2021-06-11T07:45:13.679-07:00 [Info] num concurrent scans {0}
      2021-06-11T07:45:13.679-07:00 [Info] average scan response {0 ms}
      2021-06-11T07:45:13.951-07:00 [Info] [Queryport-connpool:127.0.0.1:9101] active conns 0, free conns 1 

      I was advised to raise an MB for this in `sdk-and-sdkqe` chat as it seems like a server issue, but let me know if otherwise.

      Attachments

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

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            maria.shodunke Maria Shodunke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty