[jira] [Commented] (IGNITE-3955) IgniteCache.invokeAll returns empty result set in ATOMIC cache

2016-11-24 Thread Pavel Tupitsyn (JIRA)

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

Pavel Tupitsyn commented on IGNITE-3955:


Got it, sorry, I've glanced over IGNITE-2088.

> IgniteCache.invokeAll returns empty result set in ATOMIC cache
> --
>
> Key: IGNITE-3955
> URL: https://issues.apache.org/jira/browse/IGNITE-3955
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 1.7
>Reporter: Pavel Tupitsyn
> Fix For: 2.0
>
>
> When entry processor is invoked from multiple threads, result set is 
> sometimes empty.
> This happens with ATOMIC cache, but not with TRANSACTIONAL.
> To reproduce, paste the following into GridCacheAbstractFullApiSelfTest.java:
> {code}
> public void testInvokeAllMultithreaded() throws Exception {
> final IgniteCache cache = jcache();
> final int threadCnt = 4;
> final int cnt = 9;
> final Set keys = Collections.singleton("myKey");
> GridTestUtils.runMultiThreaded(new Runnable() {
> @Override public void run() {
> for (int i = 0; i < cnt; i++) {
> final Map res =
> cache.invokeAll(keys, new CacheEntryProcessor Integer, Integer>() {
> @Override
> public Integer process(MutableEntry Integer> entry,
> Object... objects) throws 
> EntryProcessorException {
> Integer val = entry.getValue();
> if (val == null)
> val = 0;
> val++;
> entry.setValue(val);
> return val;
> }
> });
> assertEquals(1, res.size());
> }
> }
> }, threadCnt, "testInvokeAllMultithreaded");
> assertEquals(cnt*threadCnt, (int)cache.get("myKey"));
> }
> {code}
> Run this test as part of GridCacheAtomicFullApiSelfTest.java.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (IGNITE-3955) IgniteCache.invokeAll returns empty result set in ATOMIC cache

2016-11-24 Thread Semen Boikov (JIRA)

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

Semen Boikov commented on IGNITE-3955:
--

Pavel, agree, this is discussed in IGNITE-2088, we do need two issues for this 
problem.

> IgniteCache.invokeAll returns empty result set in ATOMIC cache
> --
>
> Key: IGNITE-3955
> URL: https://issues.apache.org/jira/browse/IGNITE-3955
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 1.7
>Reporter: Pavel Tupitsyn
>Assignee: Semen Boikov
> Fix For: 2.0
>
>
> When entry processor is invoked from multiple threads, result set is 
> sometimes empty.
> This happens with ATOMIC cache, but not with TRANSACTIONAL.
> To reproduce, paste the following into GridCacheAbstractFullApiSelfTest.java:
> {code}
> public void testInvokeAllMultithreaded() throws Exception {
> final IgniteCache cache = jcache();
> final int threadCnt = 4;
> final int cnt = 9;
> final Set keys = Collections.singleton("myKey");
> GridTestUtils.runMultiThreaded(new Runnable() {
> @Override public void run() {
> for (int i = 0; i < cnt; i++) {
> final Map res =
> cache.invokeAll(keys, new CacheEntryProcessor Integer, Integer>() {
> @Override
> public Integer process(MutableEntry Integer> entry,
> Object... objects) throws 
> EntryProcessorException {
> Integer val = entry.getValue();
> if (val == null)
> val = 0;
> val++;
> entry.setValue(val);
> return val;
> }
> });
> assertEquals(1, res.size());
> }
> }
> }, threadCnt, "testInvokeAllMultithreaded");
> assertEquals(cnt*threadCnt, (int)cache.get("myKey"));
> }
> {code}
> Run this test as part of GridCacheAtomicFullApiSelfTest.java.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (IGNITE-3955) IgniteCache.invokeAll returns empty result set in ATOMIC cache

2016-11-24 Thread Pavel Tupitsyn (JIRA)

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

Pavel Tupitsyn commented on IGNITE-3955:


If this does not work, I think we should do the following:
* Throw an exception from invokeAll when in CLOCK mode
* Update javadoc

Otherwise we have an API that does not work.

> IgniteCache.invokeAll returns empty result set in ATOMIC cache
> --
>
> Key: IGNITE-3955
> URL: https://issues.apache.org/jira/browse/IGNITE-3955
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 1.7
>Reporter: Pavel Tupitsyn
>Assignee: Semen Boikov
> Fix For: 2.0
>
>
> When entry processor is invoked from multiple threads, result set is 
> sometimes empty.
> This happens with ATOMIC cache, but not with TRANSACTIONAL.
> To reproduce, paste the following into GridCacheAbstractFullApiSelfTest.java:
> {code}
> public void testInvokeAllMultithreaded() throws Exception {
> final IgniteCache cache = jcache();
> final int threadCnt = 4;
> final int cnt = 9;
> final Set keys = Collections.singleton("myKey");
> GridTestUtils.runMultiThreaded(new Runnable() {
> @Override public void run() {
> for (int i = 0; i < cnt; i++) {
> final Map res =
> cache.invokeAll(keys, new CacheEntryProcessor Integer, Integer>() {
> @Override
> public Integer process(MutableEntry Integer> entry,
> Object... objects) throws 
> EntryProcessorException {
> Integer val = entry.getValue();
> if (val == null)
> val = 0;
> val++;
> entry.setValue(val);
> return val;
> }
> });
> assertEquals(1, res.size());
> }
> }
> }, threadCnt, "testInvokeAllMultithreaded");
> assertEquals(cnt*threadCnt, (int)cache.get("myKey"));
> }
> {code}
> Run this test as part of GridCacheAtomicFullApiSelfTest.java.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (IGNITE-3955) IgniteCache.invokeAll returns empty result set in ATOMIC cache

2016-11-16 Thread Konstantin Dudkov (JIRA)

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

Konstantin Dudkov commented on IGNITE-3955:
---

branch with test fixed: 
https://github.com/gridgain/apache-ignite/commits/ignite-3955

> IgniteCache.invokeAll returns empty result set in ATOMIC cache
> --
>
> Key: IGNITE-3955
> URL: https://issues.apache.org/jira/browse/IGNITE-3955
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 1.7
>Reporter: Pavel Tupitsyn
>Assignee: Konstantin Dudkov
> Fix For: 1.8
>
>
> When entry processor is invoked from multiple threads, result set is 
> sometimes empty.
> This happens with ATOMIC cache, but not with TRANSACTIONAL.
> To reproduce, paste the following into GridCacheAbstractFullApiSelfTest.java:
> {code}
> public void testInvokeAllMultithreaded() throws Exception {
> final IgniteCache cache = jcache();
> final int threadCnt = 4;
> final int cnt = 9;
> final Set keys = Collections.singleton("myKey");
> GridTestUtils.runMultiThreaded(new Runnable() {
> @Override public void run() {
> for (int i = 0; i < cnt; i++) {
> final Map res =
> cache.invokeAll(keys, new CacheEntryProcessor Integer, Integer>() {
> @Override
> public Integer process(MutableEntry Integer> entry,
> Object... objects) throws 
> EntryProcessorException {
> Integer val = entry.getValue();
> if (val == null)
> val = 0;
> val++;
> entry.setValue(val);
> return val;
> }
> });
> assertEquals(1, res.size());
> }
> }
> }, threadCnt, "testInvokeAllMultithreaded");
> assertEquals(cnt*threadCnt, (int)cache.get("myKey"));
> }
> {code}
> Run this test as part of GridCacheAtomicFullApiSelfTest.java.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (IGNITE-3955) IgniteCache.invokeAll returns empty result set in ATOMIC cache

2016-11-15 Thread Pavel Tupitsyn (JIRA)

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

Pavel Tupitsyn commented on IGNITE-3955:


[~kdudkov] The issue is not about the test.

Our API allows invokeAll in any cache mode, and fails to return correct results 
in some of them.
We should either fix this, or restrict invokeAll to certain cache modes and 
throw exception in other modes (and document this accordingly).

> IgniteCache.invokeAll returns empty result set in ATOMIC cache
> --
>
> Key: IGNITE-3955
> URL: https://issues.apache.org/jira/browse/IGNITE-3955
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 1.7
>Reporter: Pavel Tupitsyn
>Assignee: Konstantin Dudkov
> Fix For: 1.8
>
>
> When entry processor is invoked from multiple threads, result set is 
> sometimes empty.
> This happens with ATOMIC cache, but not with TRANSACTIONAL.
> To reproduce, paste the following into GridCacheAbstractFullApiSelfTest.java:
> {code}
> public void testInvokeAllMultithreaded() throws Exception {
> final IgniteCache cache = jcache();
> final int threadCnt = 4;
> final int cnt = 9;
> final Set keys = Collections.singleton("myKey");
> GridTestUtils.runMultiThreaded(new Runnable() {
> @Override public void run() {
> for (int i = 0; i < cnt; i++) {
> final Map res =
> cache.invokeAll(keys, new CacheEntryProcessor Integer, Integer>() {
> @Override
> public Integer process(MutableEntry Integer> entry,
> Object... objects) throws 
> EntryProcessorException {
> Integer val = entry.getValue();
> if (val == null)
> val = 0;
> val++;
> entry.setValue(val);
> return val;
> }
> });
> assertEquals(1, res.size());
> }
> }
> }, threadCnt, "testInvokeAllMultithreaded");
> assertEquals(cnt*threadCnt, (int)cache.get("myKey"));
> }
> {code}
> Run this test as part of GridCacheAtomicFullApiSelfTest.java.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (IGNITE-3955) IgniteCache.invokeAll returns empty result set in ATOMIC cache

2016-11-15 Thread Konstantin Dudkov (JIRA)

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

Konstantin Dudkov commented on IGNITE-3955:
---

Looks like test fails in CLOCK atomicWriteOrderMode, but IMHO in that mode you 
can't use invoke (concurrent invokes possible). So I've added condition check 
to you test and pushed it to branch ignite-3955

{code}
public void testInvokeAllMultithreaded() throws Exception {
final IgniteCache cache = jcache();
final int threadCnt = 4;
final int cnt = 9;

// it's no use to run invoke with CLOCK atomicWriteOrderMode
if (atomicityMode() == ATOMIC && 
grid(0).context().cache().cacheConfiguration(null).getAtomicWriteOrderMode() == 
CLOCK)
return;

final Set keys = Collections.singleton("myKey");

GridTestUtils.runMultiThreaded(new Runnable() {
@Override public void run() {
for (int i = 0; i < cnt; i++) {
final Map res =
cache.invokeAll(keys, new CacheEntryProcessor() {
@Override
public Integer process(MutableEntry entry,
Object... objects) throws 
EntryProcessorException {
Integer val = entry.getValue();

if (val == null)
val = 0;

val++;

entry.setValue(val);

return val;
}
});

assert res.size() == 1;
}
}
}, threadCnt, "testInvokeAllMultithreaded");
assertEquals(cnt * threadCnt, (int)cache.get("myKey"));
}
{code}

> IgniteCache.invokeAll returns empty result set in ATOMIC cache
> --
>
> Key: IGNITE-3955
> URL: https://issues.apache.org/jira/browse/IGNITE-3955
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 1.7
>Reporter: Pavel Tupitsyn
>Assignee: Konstantin Dudkov
> Fix For: 1.8
>
>
> When entry processor is invoked from multiple threads, result set is 
> sometimes empty.
> This happens with ATOMIC cache, but not with TRANSACTIONAL.
> To reproduce, paste the following into GridCacheAbstractFullApiSelfTest.java:
> {code}
> public void testInvokeAllMultithreaded() throws Exception {
> final IgniteCache cache = jcache();
> final int threadCnt = 4;
> final int cnt = 9;
> final Set keys = Collections.singleton("myKey");
> GridTestUtils.runMultiThreaded(new Runnable() {
> @Override public void run() {
> for (int i = 0; i < cnt; i++) {
> final Map res =
> cache.invokeAll(keys, new CacheEntryProcessor Integer, Integer>() {
> @Override
> public Integer process(MutableEntry Integer> entry,
> Object... objects) throws 
> EntryProcessorException {
> Integer val = entry.getValue();
> if (val == null)
> val = 0;
> val++;
> entry.setValue(val);
> return val;
> }
> });
> assertEquals(1, res.size());
> }
> }
> }, threadCnt, "testInvokeAllMultithreaded");
> assertEquals(cnt*threadCnt, (int)cache.get("myKey"));
> }
> {code}
> Run this test as part of GridCacheAtomicFullApiSelfTest.java.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)