[jira] [Commented] (IGNITE-6507) Commit can be lost in network split scenario

2017-10-12 Thread Alexandr Kuramshin (JIRA)

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

Alexandr Kuramshin commented on IGNITE-6507:


I've found that after {{GridDhtTxPrepareFuture.onNodeLeft()}} makes all its 
miniFuts done, and {{GridNearTxLocal}} prepareFut.listener calls 
{{GridNearTxFinishFuture.finish(true, true)}} (with commit) then 
{{GridDhtTxFinishRequest}} will be send.

Upon sending {{GridDhtTxFinishRequest}} a {{ClusterTopologyCheckedException}} 
will be thrown and {{GridDhtTxFinishFuture.MiniFuture.onNodeLeft()}} makes 
{{GridNearTxLocal}} successfully committed.

[~ascherbakov],

do you suppose to be transaction rolled back when 
{{GridDhtTxPrepareFuture.onNodeLeft()}} occurs?

> Commit can be lost in network split scenario
> 
>
> Key: IGNITE-6507
> URL: https://issues.apache.org/jira/browse/IGNITE-6507
> Project: Ignite
>  Issue Type: Bug
>  Components: general
>Affects Versions: 2.1
>Reporter: Alexei Scherbakov
>Priority: Critical
>  Labels: important
> Fix For: 2.4
>
>
> Commit can be lost in network split scenario
> Reproducer:
> https://github.com/ascherbakoff/ignite/blob/ignite-6507/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheTopologySplitTxConsistencyTest.java
> If routing will be switched to second data center, new transactions will no 
> see commited state.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (IGNITE-6507) Commit can be lost in network split scenario

2017-09-28 Thread Alexei Scherbakov (JIRA)

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

Alexei Scherbakov commented on IGNITE-6507:
---

Added split emulation in reproducer.

> Commit can be lost in network split scenario
> 
>
> Key: IGNITE-6507
> URL: https://issues.apache.org/jira/browse/IGNITE-6507
> Project: Ignite
>  Issue Type: Bug
>  Components: general
>Affects Versions: 2.1
>Reporter: Alexei Scherbakov
>Priority: Critical
>  Labels: important
> Fix For: 2.4
>
>
> Commit can be lost in network split scenario
> Reproducer:
> https://github.com/ascherbakoff/ignite/blob/ignite-6507/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheTopologySplitTxConsistencyTest.java
> If routing will be switched to second data center, new transactions will no 
> see commited state.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (IGNITE-6507) Commit can be lost in network split scenario

2017-09-27 Thread Alexei Scherbakov (JIRA)

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

Alexei Scherbakov commented on IGNITE-6507:
---

[~sboikov],

The test demonstrates a problem on commit phase: commit is successful on 
primary node and not successful on backup nodes in network split scenario 
(simulated in test by stopping backup nodes in wrongtime).

In network split scenario usually single DC is selected for transaction 
processing, and if wrong DC is selected the commit is lost (as shown in test)

I can try to implement network split emulation in test by somehow hacking 
TcpDiscoverySpi. Could you suggest a proper way ?


> Commit can be lost in network split scenario
> 
>
> Key: IGNITE-6507
> URL: https://issues.apache.org/jira/browse/IGNITE-6507
> Project: Ignite
>  Issue Type: Bug
>  Components: general
>Affects Versions: 2.1
>Reporter: Alexei Scherbakov
>Priority: Critical
> Fix For: 2.3
>
>
> Commit can be lost in network split scenario
> {noformat}
> /*
>  * Licensed to the Apache Software Foundation (ASF) under one or more
>  * contributor license agreements. See the NOTICE file distributed with
>  * this work for additional information regarding copyright ownership.
>  * The ASF licenses this file to You under the Apache License, Version 2.0
>  * (the "License"); you may not use this file except in compliance with
>  * the License. You may obtain a copy of the License at
>  *
>  * http://www.apache.org/licenses/LICENSE-2.0
>  *
>  * Unless required by applicable law or agreed to in writing, software
>  * distributed under the License is distributed on an "AS IS" BASIS,
>  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>  * See the License for the specific language governing permissions and
>  * limitations under the License.
>  */
> package org.apache.ignite.internal.processors.cache.distributed.dht;
> import org.apache.ignite.IgniteCache;
> import org.apache.ignite.cache.affinity.Affinity;
> import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
> import org.apache.ignite.configuration.BinaryConfiguration;
> import org.apache.ignite.configuration.CacheConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.configuration.MemoryConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.internal.IgniteInternalFuture;
> import org.apache.ignite.internal.TestRecordingCommunicationSpi;
> import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
> import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
> import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
> import org.apache.ignite.testframework.GridTestUtils;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
> import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
> /**
>  * Tests commit consitency in split-brain scenario.
>  */
> public class GridCacheGridSplitTxConsistencyTest extends 
> GridCommonAbstractTest {
> /** */
> private static final TcpDiscoveryIpFinder IP_FINDER = new 
> TcpDiscoveryVmIpFinder(true);
> /**
>  * {@inheritDoc}
>  */
> @Override protected void afterTest() throws Exception {
> super.afterTest();
> stopAllGrids();
> GridTestUtils.deleteDbFiles();
> }
> /**
>  * {@inheritDoc}
>  */
> @Override protected IgniteConfiguration getConfiguration(String gridName) 
> throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(gridName);
> cfg.setCommunicationSpi(new TestRecordingCommunicationSpi());
> cfg.setConsistentId(gridName);
> MemoryConfiguration memCfg = new MemoryConfiguration();
> memCfg.setPageSize(1024);
> memCfg.setDefaultMemoryPolicySize(100 * 1024 * 1024);
> cfg.setMemoryConfiguration(memCfg);
> ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
> CacheConfiguration ccfg = new CacheConfiguration();
> ccfg.setName(DEFAULT_CACHE_NAME);
> ccfg.setAtomicityMode(TRANSACTIONAL);
> ccfg.setWriteSynchronizationMode(FULL_SYNC);
> ccfg.setAffinity(new RendezvousAffinityFunction(false, 3));
> ccfg.setBackups(2);
> cfg.setCacheConfiguration(ccfg);
> return cfg;
> }
> /**
>  * Tests if commits are working as expected.
>  * @throws Exception
>  */
> public void testSplitTxConsistency() throws Exception {
> IgniteEx grid0 = startGrid(0);
> grid0.active(true);
> IgniteEx grid1 = startGrid(1);
> IgniteEx grid2 

[jira] [Commented] (IGNITE-6507) Commit can be lost in network split scenario

2017-09-27 Thread Semen Boikov (JIRA)

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

Semen Boikov commented on IGNITE-6507:
--

[~ascherbakov], this test does not make sense to me, after put was finished 
there is only one node in cluster, after this node was stopped data was lost. 
Not clear what problem you are trying to demonstrate.

> Commit can be lost in network split scenario
> 
>
> Key: IGNITE-6507
> URL: https://issues.apache.org/jira/browse/IGNITE-6507
> Project: Ignite
>  Issue Type: Bug
>  Components: general
>Affects Versions: 2.1
>Reporter: Alexei Scherbakov
>Priority: Critical
> Fix For: 2.3
>
>
> Commit can be lost in network split scenario
> {noformat}
> /*
>  * Licensed to the Apache Software Foundation (ASF) under one or more
>  * contributor license agreements. See the NOTICE file distributed with
>  * this work for additional information regarding copyright ownership.
>  * The ASF licenses this file to You under the Apache License, Version 2.0
>  * (the "License"); you may not use this file except in compliance with
>  * the License. You may obtain a copy of the License at
>  *
>  * http://www.apache.org/licenses/LICENSE-2.0
>  *
>  * Unless required by applicable law or agreed to in writing, software
>  * distributed under the License is distributed on an "AS IS" BASIS,
>  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>  * See the License for the specific language governing permissions and
>  * limitations under the License.
>  */
> package org.apache.ignite.internal.processors.cache.distributed.dht;
> import org.apache.ignite.IgniteCache;
> import org.apache.ignite.cache.affinity.Affinity;
> import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
> import org.apache.ignite.configuration.BinaryConfiguration;
> import org.apache.ignite.configuration.CacheConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.configuration.MemoryConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.internal.IgniteInternalFuture;
> import org.apache.ignite.internal.TestRecordingCommunicationSpi;
> import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
> import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
> import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
> import org.apache.ignite.testframework.GridTestUtils;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
> import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
> /**
>  * Tests commit consitency in split-brain scenario.
>  */
> public class GridCacheGridSplitTxConsistencyTest extends 
> GridCommonAbstractTest {
> /** */
> private static final TcpDiscoveryIpFinder IP_FINDER = new 
> TcpDiscoveryVmIpFinder(true);
> /**
>  * {@inheritDoc}
>  */
> @Override protected void afterTest() throws Exception {
> super.afterTest();
> stopAllGrids();
> GridTestUtils.deleteDbFiles();
> }
> /**
>  * {@inheritDoc}
>  */
> @Override protected IgniteConfiguration getConfiguration(String gridName) 
> throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(gridName);
> cfg.setCommunicationSpi(new TestRecordingCommunicationSpi());
> cfg.setConsistentId(gridName);
> MemoryConfiguration memCfg = new MemoryConfiguration();
> memCfg.setPageSize(1024);
> memCfg.setDefaultMemoryPolicySize(100 * 1024 * 1024);
> cfg.setMemoryConfiguration(memCfg);
> ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
> CacheConfiguration ccfg = new CacheConfiguration();
> ccfg.setName(DEFAULT_CACHE_NAME);
> ccfg.setAtomicityMode(TRANSACTIONAL);
> ccfg.setWriteSynchronizationMode(FULL_SYNC);
> ccfg.setAffinity(new RendezvousAffinityFunction(false, 3));
> ccfg.setBackups(2);
> cfg.setCacheConfiguration(ccfg);
> return cfg;
> }
> /**
>  * Tests if commits are working as expected.
>  * @throws Exception
>  */
> public void testSplitTxConsistency() throws Exception {
> IgniteEx grid0 = startGrid(0);
> grid0.active(true);
> IgniteEx grid1 = startGrid(1);
> IgniteEx grid2 = startGrid(2);
> int key = 0;
> Affinity aff = grid0.affinity(DEFAULT_CACHE_NAME);
> assertTrue(aff.isPrimary(grid0.localNode(), key));
> assertTrue(aff.isBackup(grid1.localNode(), key));
> assertTrue(aff.isBackup(grid2.localNode(), key));
> final