Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-6335

Dist Stream iterator can return with no results in some cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.2.0.Final
    • 8.1.2.Final
    • Clustered Executor
    • None

      The distributed iterator will process entries locally if it owns all of the segments (backup or primary). If all of the entries are able to be stored in a single batch size (distributedBatchSize) then it is possible for the iterator to be closed before it can return a value.

      The issue is that the results are passed to the queue and then the iterator is closed. Unfortunately there is a very small gap in IteratorSupplier of DistributedCacheStream where it polls the queue and then checks completed flag (set by closing iterator). If the results are put into the queue and the primary thread was suspended after checking the queue but then wakes up and sees the completion it will return no results. This is reproducible with the new ReplicatedStreamRehashTest but doesn't require rehashs to occur.

      The following are the 2 places affected.

      https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/stream/impl/DistributedCacheStream.java#L733
      &
      https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/stream/impl/DistributedCacheStream.java#L742

              wburns@redhat.com Will Burns
              wburns@redhat.com Will Burns
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: