-
Bug
-
Resolution: Done
-
Major
-
8.1.2.Final
-
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