[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-03-10 Thread Ivan Pavlukhin (Jira)


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

Ivan Pavlukhin commented on IGNITE-12549:
-

[~macrergate], I believe we can include it into 2.8.1 but as far as I know 
neither 2.8.1 branch was created neither scope was discussed. We cannot put fix 
version 2.8.1 immediately here because RESOLVED ticket status can be misleading 
if the patch will not appear in 2.8.1 by some reason. It seems that we can add 
2.8.1 fix version only when the fix will be merged to 2.8.1 branch.

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.9
>
>  Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-03-09 Thread Sergey Kosarev (Jira)


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

Sergey Kosarev commented on IGNITE-12549:
-

[~Pavlukhin], thank you! Shouldn't it go to 2.8.1 also? 

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.9
>
>  Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-03-04 Thread Ivan Pavlukhin (Jira)


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

Ivan Pavlukhin commented on IGNITE-12549:
-

[~macrergate], sorry, I had a lack of time to check it. Will do in a couple of 
days.

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.9, 2.8.1
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-02-28 Thread Sergey Kosarev (Jira)


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

Sergey Kosarev commented on IGNITE-12549:
-

[~Pavlukhin], please look. no blockers here, do you give final approve? 

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.9, 2.8.1
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-02-28 Thread Ignite TC Bot (Jira)


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

Ignite TC Bot commented on IGNITE-12549:


{panel:title=Branch: [pull/7277/head] Base: [master] : No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
[TeamCity *-- Run :: All* 
Results|https://ci.ignite.apache.org/viewLog.html?buildId=5086468buildTypeId=IgniteTests24Java8_RunAll]

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.9, 2.8.1
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-02-27 Thread Ignite TC Bot (Jira)


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

Ignite TC Bot commented on IGNITE-12549:


{panel:title=Branch: [pull/7277/head] Base: [master] : Possible Blockers 
(5)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1}
{color:#d04437}Cache 5{color} [[tests 
1|https://ci.ignite.apache.org/viewLog.html?buildId=5086421]]
* IgniteCacheWithIndexingTestSuite: 
ClusterReadOnlyModeDoesNotBreakSqlSelectTest.test - Test has low fail rate in 
base branch 0,0% and is not flaky

{color:#d04437}Scala (Examples){color} [[tests 0 Exit Code 
|https://ci.ignite.apache.org/viewLog.html?buildId=5086389]]

{color:#d04437}Basic 1{color} [[tests 
1|https://ci.ignite.apache.org/viewLog.html?buildId=5086396]]
* IgniteBasicTestSuite: BPlusTreeFakeReuseSelfTest.testMassiveRemove2_true - 
Test has low fail rate in base branch 0,0% and is not flaky

{color:#d04437}Basic 2{color} [[tests 
1|https://ci.ignite.apache.org/viewLog.html?buildId=5086356]]
* IgniteComputeBasicConfigVariationsFullApiTestSuite: 
IgniteComputeConfigVariationsFullApiTest_46.testDeployExecuteByName - Test has 
low fail rate in base branch 0,0% and is not flaky

{color:#d04437}Thin client: Python{color} [[tests 0 Exit Code 
|https://ci.ignite.apache.org/viewLog.html?buildId=5086445]]

{panel}
[TeamCity *-- Run :: All* 
Results|https://ci.ignite.apache.org/viewLog.html?buildId=5086468buildTypeId=IgniteTests24Java8_RunAll]

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.9, 2.8.1
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-02-27 Thread Sergey Kosarev (Jira)


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

Sergey Kosarev commented on IGNITE-12549:
-

[~Pavlukhin], thanks, I made changes and replied, TC in progress.

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.9, 2.8.1
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-02-21 Thread Ivan Pavlukhin (Jira)


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

Ivan Pavlukhin commented on IGNITE-12549:
-

[~macrergate], approach with topology read lock looks fine to me. I left some 
comments on GitHub.

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-02-19 Thread Sergey Kosarev (Jira)


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

Sergey Kosarev commented on IGNITE-12549:
-

[~Pavlukhin], no problem at all, it can wait. Just don't forget about me.

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-02-18 Thread Ivan Pavlukhin (Jira)


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

Ivan Pavlukhin commented on IGNITE-12549:
-

[~macrergate], I need some more time to evaluate the proposed solution. You 
might ask someone else to review if you need it faster.

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-02-18 Thread Ivan Pavlukhin (Jira)


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

Ivan Pavlukhin commented on IGNITE-12549:
-

[~macrergate], I will take a look today.

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-02-18 Thread Sergey Kosarev (Jira)


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

Sergey Kosarev commented on IGNITE-12549:
-

[~Pavlukhin], I've updated PR and replied to you, please check 
[PR-7277|https://github.com/apache/ignite/pull/7277].

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Assignee: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-01-22 Thread Sergey Kosarev (Jira)


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

Sergey Kosarev commented on IGNITE-12549:
-

[~Pavlukhin], thanks. Please check my reply there.

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-01-22 Thread Ivan Pavlukhin (Jira)


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

Ivan Pavlukhin commented on IGNITE-12549:
-

[~macrergate], please check my comment on 
[GitHub|https://github.com/apache/ignite/pull/7277].

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-01-21 Thread Ignite TC Bot (Jira)


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

Ignite TC Bot commented on IGNITE-12549:


{panel:title=Branch: [pull/7277/head] Base: [master] : No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
[TeamCity *-- Run :: All* 
Results|https://ci.ignite.apache.org/viewLog.html?buildId=4946509buildTypeId=IgniteTests24Java8_RunAll]

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-01-21 Thread Ignite TC Bot (Jira)


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

Ignite TC Bot commented on IGNITE-12549:


{panel:title=Branch: [pull/7277/head] Base: [master] : Possible Blockers 
(2)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1}
{color:#d04437}Cache 5{color} [[tests 
1|https://ci.ignite.apache.org/viewLog.html?buildId=4946462]]
* IgniteCacheTestSuite5: 
IgniteCachePartitionLossPolicySelfTest.testReadWriteSafeWithPersistence[TRANSACTIONAL]
 - Test has low fail rate in base branch 0,0% and is not flaky

{color:#d04437}Cache 7{color} [[tests 
1|https://ci.ignite.apache.org/viewLog.html?buildId=4946464]]
* IgniteCacheTestSuite7: 
AuthenticationProcessorNodeRestartTest.test1kUsersNodeRestartServer - Test has 
low fail rate in base branch 0,0% and is not flaky

{panel}
[TeamCity *-- Run :: All* 
Results|https://ci.ignite.apache.org/viewLog.html?buildId=4946509buildTypeId=IgniteTests24Java8_RunAll]

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-01-21 Thread Sergey Kosarev (Jira)


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

Sergey Kosarev commented on IGNITE-12549:
-

[~Pavlukhin], can you please review my PR?

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-01-20 Thread Sergey Kosarev (Jira)


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

Sergey Kosarev commented on IGNITE-12549:
-

[~Pavlukhin], there is a difference. 

I've found the second problem in the method: 
{{org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl#projection}}

there is stacktrace:

projection:628, IgniteCacheProxyImpl 
(org.apache.ignite.internal.processors.cache)
query:809, IgniteCacheProxyImpl (org.apache.ignite.internal.processors.cache)
query:412, GatewayProtectedCacheProxy 
(org.apache.ignite.internal.processors.cache)

 

it looks like {{IgniteCacheProxyImpl#projection somewhat duplicates logic of 
}}org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()

and both have the same error - lacks the check for moving partitions.

 

 

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-01-20 Thread Ivan Pavlukhin (Jira)


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

Ivan Pavlukhin commented on IGNITE-12549:
-

[~macrergate], seems very common to IGNITE-12482. Can it be fixed similarly?

> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Priority: Critical
> Fix For: 2.8
>
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-01-16 Thread Sergey Kosarev (Jira)


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

Sergey Kosarev commented on IGNITE-12549:
-

[~ascherbakov], thanks for WA, I see.
About fix you suggested I agree it can fix case 1, but how to fix case 2 when 
scanQuery is executed from a client node? 
Can client check that a remote node doesn't have moving partitions?


> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Priority: Major
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IGNITE-12549) Scan query/iterator on a replicated cache may get wrong results

2020-01-16 Thread Alexey Scherbakov (Jira)


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

Alexey Scherbakov commented on IGNITE-12549:


[~macrergate]

Looks like the fix is to avoid local iterator for replicated cache if local 
node has moving partitions.

As a workaround set partition for a query explicitly: query.partition(p)  where 
p in 0..PARTS_CNT


> Scan query/iterator on a replicated cache may get wrong results
> ---
>
> Key: IGNITE-12549
> URL: https://issues.apache.org/jira/browse/IGNITE-12549
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 2.7.6
>Reporter: Sergey Kosarev
>Priority: Major
>
> Case 1
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start servr node 2 
> 4. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the node 2
> It can get empty or partial results. (if rebalance on node 2 is finished)
> Case 2
> 1. start server node 1
> 2. create and fill replicated cache with RebalanceMode.Async (as by default)
> 3. start client node 2
> 4. start server node 3 
> 5. immediately execute scan query  on the replicated cache((or just iterate 
> the cache)) on the client node 2
> It can get empty or partial results. (if rebalance on node 2 is not finished 
> and query is mapped on the node 2)
> It looks like problem in the 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#nodes()
> case REPLICATED:
> if (prj != null || part != null)
> return nodes(cctx, prj, part);
> if (cctx.affinityNode())
> return *Collections.singletonList(cctx.localNode())*;
> Collection affNodes = nodes(cctx, null, null);
> return affNodes.isEmpty() ? affNodes : 
> *Collections.singletonList(F.rand(affNodes))*;
> case PARTITIONED:
> return nodes(cctx, prj, part);
>  which is executed in 
> org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter#executeScanQuery.
> If executed on a just started node it obviously returns the local node 
> disregarding was it rebalanced or not.
> If executed on a client it returns a random affinity node, so it also can be 
> not yet rebalanced node.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)