Uploaded image for project: 'Java Couchbase JVM Core'
  1. Java Couchbase JVM Core
  2. JVMCBC-1357

lookupInAllReplicas results in not enough replicas if get("") is used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • None
    • None
    • None
    • 1
    • SDK02: V.Search, maxTTL=-1

    Description

      This code:

          Collection coll = cluster.bucket("default").defaultCollection();
       
          String docId = UUID.randomUUID().toString();
          coll.upsert(docId, JsonObject.create());
       
          List<LookupInReplicaResult> results = coll
            .lookupInAllReplicas(docId, CbCollections.listOf(get("")))
            .collect(Collectors.toList());
       
          System.out.println(results.size());
      

      and FIT test getWholeDocumentLookup() result in only 1 result being returned.

      Note the buckets created by the JVM integration tests are setup with 0 replicas, so will always result in just 1 replica. I'm explicitly using bucket "default" here which I've configured with 1 replica, so I expect 2 results back (active + replica).

      I added some internal logging and see this error occurring on one of the replica streams:

      Error com.couchbase.client.core.error.DecodingFailureException: java.lang.IndexOutOfBoundsException: readerIndex(6) + length(1701999215) exceeds writerIndex(54): AbstractPooledDerivedByteBuf$PooledNonRetainedSlicedByteBuf(ridx: 6, widx: 54, cap: 54/54, unwrapped: PooledUnsafeDirectByteBuf(ridx: 81, widx: 81, cap: 16384))
      

      This was another one caught by FIT, so again thanks to Matthew Bray

      As part of fixing, please re-enable the tests I've temporarily @IgnoreWhen-ed in FIT in https://review.couchbase.org/c/transactions-fit-performer/+/195104.

      Attachments

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

        Activity

          People

            graham.pople Graham Pople
            graham.pople Graham Pople
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty