[ 
https://issues.apache.org/jira/browse/IGNITE-8288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Belyak updated IGNITE-8288:
-------------------------------------
    Description: 
1) Create partitioned cache with backups and readFromBackup(false) on 2+ nodes 
cluster
2) Select some partition N, local node should not be primary of partition N
3) execute: cache.query(new ScanQuery<>().setLocal(true).setPartition(N))
Expected result:
empty result (probaply with logging smth like "Trying to execute local query 
<query> by primarypartitions with non pridmary local partition N") or even 
throw exception
Actual result:
executing (with ScanQueryFallbackClosableIterator) query on local node ignoring 
readFromBackups flag.
Problem is that we execute query on backup partitions even if readFromBackups 
explicitly set to false.
This happen because in IgniteCacheProxyImpl.query(ScanQuery, IgniteClosure, 
ClusterGroup) we create GridCacheQueryAdapter 
(=ctx.queries()createScanQuery...) without pass readFromBackups flag into 
includeBackups in GridCacheQueryAdapter, and, moreover, in  
GridCacheQueryManager.scanQueryLocal(GridCacheQueryAdapter, boolean) we create 
scanIterator not padyint attention to this flag if partition is set.






  was:


1) Create partitioned cache with backups and readFromBackup(false) on 2+ nodes 
cluster
2) Select some partition N, local node should not be primary of partition N
3) execute: cache.query(new ScanQuery<>().setLocal(true).setPartition(N))
Expected result:
empty result (probaply with logging smth like "Trying to execute local query 
<query> by primarypartitions with non pridmary local partition N") or even 
throw exception
Actual result:
executing (with ScanQueryFallbackClosableIterator) query on local node ignoring 
readFromBackups flag.
Problem is that we execute query on backup partitions even if readFromBackups 
explicitly set to false.
Same behaviour can be achieved if we get empty node list from 
GridCacheQueryAdapter.node() by any reasons, for example - if we run "local" 
query from non data node from given cache (see 
GridDiscoveryNamager.cacheAffinityNode(ClusterNode node, String cacheName) in 
GridcacheQueryAdapter.executeScanQuery()





GridCacheQueryAdapter


> ScanQuery ignore readFromBackups
> --------------------------------
>
>                 Key: IGNITE-8288
>                 URL: https://issues.apache.org/jira/browse/IGNITE-8288
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Alexander Belyak
>            Priority: Major
>
> 1) Create partitioned cache with backups and readFromBackup(false) on 2+ 
> nodes cluster
> 2) Select some partition N, local node should not be primary of partition N
> 3) execute: cache.query(new ScanQuery<>().setLocal(true).setPartition(N))
> Expected result:
> empty result (probaply with logging smth like "Trying to execute local query 
> <query> by primarypartitions with non pridmary local partition N") or even 
> throw exception
> Actual result:
> executing (with ScanQueryFallbackClosableIterator) query on local node 
> ignoring readFromBackups flag.
> Problem is that we execute query on backup partitions even if readFromBackups 
> explicitly set to false.
> This happen because in IgniteCacheProxyImpl.query(ScanQuery, IgniteClosure, 
> ClusterGroup) we create GridCacheQueryAdapter 
> (=ctx.queries()createScanQuery...) without pass readFromBackups flag into 
> includeBackups in GridCacheQueryAdapter, and, moreover, in  
> GridCacheQueryManager.scanQueryLocal(GridCacheQueryAdapter, boolean) we 
> create scanIterator not padyint attention to this flag if partition is set.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to