[ 
https://issues.apache.org/jira/browse/IGNITE-16031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17454666#comment-17454666
 ] 

Maksim Timonin commented on IGNITE-16031:
-----------------------------------------

Hi [~slava.koptilin] !

I dived into SQL processing, and found that SQL uses a logic for reserving 
partitions for such cases. See `PartitionReservationManager`. I'd like to reuse 
the logic for IndexQuery, because it works pretty same way as SQL does: fetches 
data from indexes of required partitions. But, from other side, IndexQuery also 
shares processing with other cache queries, ScanQuery and TextQuery.

So, it looks like I can bring logic of reserving for all cache queries types. 
AFAIU, it wasn't done before, because ScanQuery is used in most cases with 
specified partition only. Maybe you're aware of that, is there any other known 
issues why the preserving wasn't done for ScanQuery?

 

> ScanQuery returns duplicated data 
> ----------------------------------
>
>                 Key: IGNITE-16031
>                 URL: https://issues.apache.org/jira/browse/IGNITE-16031
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.11
>            Reporter: Maksim Timonin
>            Assignee: Maksim Timonin
>            Priority: Major
>
> ScanQuery doesn't sync topology version over different nodes, so when query 
> runs on different node it can run over different topologies and can have 
> duplicated primary partition.
>  
> ```
> ignite = startGrids(1);
> cache = ignite.cache(CACHE);
> cache.put(1L, new Person(0, 1));
> cache.put(2L, new Person(1, 0));
> cache.put(3L, new Person(1, 1));
> ScanQuery qry = new ScanQuery();
> startGrid(nodesCnt);
> Thread.sleep(10);
> List<Cache.Entry<Long, Person>> result = cache.query(qry).getAll();
> assertEquals(3, result.size());  // Sometimes fails, and returns duplicated 
> key=1
> ```



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to