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

asyncBucket.lookupIn falls with an error on a locked document

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Major
    • None
    • 5.1.3
    • clients, memcached
    • None
    • Untriaged
    • Centos 64-bit
    • Unknown

    Description

      When I apply lookupIn() for unlocked document, method work properly.

      But when I  lock document and after that apply get() on this document, get() return mе document with CAS == -1. It is properly result.

      But when I used lookupIn() in same situation, this method falls with exception:

      com.couchbase.client.java.error.TemporaryFailureExceptioncom.couchbase.client.java.error.TemporaryFailureException at com.couchbase.client.java.subdoc.SubdocHelper.commonSubdocErrors(SubdocHelper.java:68) at com.couchbase.client.java.subdoc.AsyncLookupInBuilder$5.call(AsyncLookupInBuilder.java:552) at com.couchbase.client.java.subdoc.AsyncLookupInBuilder$5.call(AsyncLookupInBuilder.java:521) at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69) at rx.observers.Subscribers$5.onNext(Subscribers.java:235) at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onNext(OnSubscribeDoOnEach.java:101) at rx.internal.producers.SingleProducer.request(SingleProducer.java:65) at rx.internal.operators.DeferredScalarSubscriber.setProducer(DeferredScalarSubscriber.java:143) at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102) at rx.Subscriber.setProducer(Subscriber.java:205) at rx.Subscriber.setProducer(Subscriber.java:205) at rx.subjects.AsyncSubject.onCompleted(AsyncSubject.java:103) at com.couchbase.client.core.endpoint.AbstractGenericHandler.completeResponse(AbstractGenericHandler.java:419) at com.couchbase.client.core.endpoint.AbstractGenericHandler.access$000(AbstractGenericHandler.java:82) at com.couchbase.client.core.endpoint.AbstractGenericHandler$1.call(AbstractGenericHandler.java:437) at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.core.message.kv.subdoc.simple.SimpleSubdocResponse.class at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:118) at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:73) ... 19 more
      

      I am used this testcase:

      {{}}

       

              AsyncBucket asyncBucket =  <....>;       
              Bucket syncBucket = <.....>;
       
              String docId = "uu1";
              int lockTime = 20;   
       
           RawJsonDocument createdDocument = syncBucket
                      .upsert(RawJsonDocument.create(docId, 0, "{\"field1\":1, \"field2\":2}"));        assertTrue(createdDocument.cas() > 0);        DocumentFragment<Lookup> lookupResult = asyncBucket.lookupIn(docId)
                      .get("field1")
                      .execute()
                      .last()
                      .toBlocking()
                      .single();
              assertTrue(lookupResult.cas() > 0);        JsonDocument lockedDocument = asyncBucket
                      .getAndLock(docId, lockTime, JsonDocument.class)
                      .toBlocking()
                      .singleOrDefault(null);        assertTrue(lockedDocument.cas() > 0);        JsonDocument getResult = asyncBucket.get(docId)
                      .last()
                      .toBlocking()
                      .single();        assertEquals(-1, getResult.cas());        DocumentFragment<Lookup> lookupLockedResult = asyncBucket.lookupIn(docId)
                      .get("field1")
                      .execute()
                      .last()
                      .toBlocking()
                      .single();        assertEquals(-1, lookupLockedResult.cas());
          }
      

      Attachments

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

        Activity

          People

            owend Daniel Owen
            maxpant Maxim Pantyukhin
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty