]
William Burns updated ISPN-6335:
--------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request:
Dist Stream iterator can return with no results in some cases
-------------------------------------------------------------
Key: ISPN-6335
URL:
https://issues.jboss.org/browse/ISPN-6335
Project: Infinispan
Issue Type: Bug
Components: Distributed Execution and Map/Reduce
Affects Versions: 8.1.2.Final
Reporter: William Burns
Assignee: William Burns
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/o...
&
https://github.com/infinispan/infinispan/blob/master/core/src/main/java/o...