Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.4
-
None
-
None
-
None
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.