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

AT_PLUS queries with collections are not working

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 7.0.0
    • Neo, 7.0.2
    • 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

          Validated fix on 7.0.1-6845 and 7.1.0-1015

          INFO: [com.couchbase.node][NodeConnectedEvent] Node connected {"coreId":"0x809e73b00000001","managerPort":"8091","remote":"192.168.10.11"}
          Jun 11, 2021 10:02:54 PM com.couchbase.client.core.cnc.LoggingEventConsumer$JdkLogger info
          INFO: [com.couchbase.core][BucketOpenedEvent][189ms] Opened bucket "travel-sample" {"coreId":"0x809e73b00000001"}
          QueryResult{rows=[QueryChunkRow{data={"id":"airport_1254"}}, QueryChunkRow{data={"id":"airport_1255"}}], header=QueryChunkHeader{requestId='85e649cb-d9d1-4515-abb6-e943bb3bcd4e', signature=Optional[{"id":"json"}], clientContextId=Optional[9a8f6a19-6ae5-4906-9783-0d6d6856a77e], prepared=Optional.empty}, trailer=QueryChunkTrailer{status='success', metrics=Optional.empty, warnings=Optional.empty, errors=Optional.empty, profile=Optional.empty}}
          QueryResult{rows=[QueryChunkRow{data={"id":"airport_1254"}}, QueryChunkRow{data={"id":"airport_1255"}}], header=QueryChunkHeader{requestId='15f29764-dd80-44bd-a6e5-49383484be12', signature=Optional[{"id":"json"}], clientContextId=Optional[8544fdb2-3818-468b-8310-05f9c77ed5f6], prepared=Optional.empty}, trailer=QueryChunkTrailer{status='success', metrics=Optional.empty, warnings=Optional.empty, errors=Optional.empty, profile=Optional.empty}} 

          pierre.regazzoni Pierre Regazzoni added a comment - Validated fix on 7.0.1-6845 and 7.1.0-1015 INFO: [com.couchbase.node][NodeConnectedEvent] Node connected { "coreId" : "0x809e73b00000001" , "managerPort" : "8091" , "remote" : "192.168.10.11" } Jun 11 , 2021 10 : 02 : 54 PM com.couchbase.client.core.cnc.LoggingEventConsumer$JdkLogger info INFO: [com.couchbase.core][BucketOpenedEvent][189ms] Opened bucket "travel-sample" { "coreId" : "0x809e73b00000001" } QueryResult{rows=[QueryChunkRow{data={ "id" : "airport_1254" }}, QueryChunkRow{data={ "id" : "airport_1255" }}], header=QueryChunkHeader{requestId= '85e649cb-d9d1-4515-abb6-e943bb3bcd4e' , signature=Optional[{ "id" : "json" }], clientContextId=Optional[9a8f6a19-6ae5- 4906 - 9783 -0d6d6856a77e], prepared=Optional.empty}, trailer=QueryChunkTrailer{status= 'success' , metrics=Optional.empty, warnings=Optional.empty, errors=Optional.empty, profile=Optional.empty}} QueryResult{rows=[QueryChunkRow{data={ "id" : "airport_1254" }}, QueryChunkRow{data={ "id" : "airport_1255" }}], header=QueryChunkHeader{requestId= '15f29764-dd80-44bd-a6e5-49383484be12' , signature=Optional[{ "id" : "json" }], clientContextId=Optional[8544fdb2- 3818 -468b- 8310 -05f9c77ed5f6], prepared=Optional.empty}, trailer=QueryChunkTrailer{status= 'success' , metrics=Optional.empty, warnings=Optional.empty, errors=Optional.empty, profile=Optional.empty}}

          BTW this issue seem to be present only when using scan_vectors if you use scan_vector (query involving single bucket) it works.

          pierre.regazzoni Pierre Regazzoni added a comment - BTW this issue seem to be present only when using scan_vectors if you use scan_vector (query involving single bucket) it works.

          was verified on 7.0.1 and 7.1.0 see previous comments

          pierre.regazzoni Pierre Regazzoni added a comment - was verified on 7.0.1 and 7.1.0 see previous comments

          Description for release notes:

           
          Summary: AT_PLUS queries do not work with collections when using scan_vectors.

          amarantha.kulkarni Amarantha Kulkarni (Inactive) added a comment - Description for release notes:   Summary : AT_PLUS queries do not work with collections when using scan_vectors.

          Removing the label "releasenotes" because that was only for Cheshire-Cat.

          The bug is fixed in 7.0,1 and Neo

          kamini.jagtiani Kamini Jagtiani added a comment - Removing the label "releasenotes" because that was only for Cheshire-Cat. The bug is fixed in 7.0,1 and Neo

          People

            pierre.regazzoni Pierre Regazzoni
            maria.shodunke Maria Shodunke
            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