ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Scherbakov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IGNITE-10088) Partition is restored in moving state instead of owning if node restarted before first checkpoint.
Date Wed, 31 Oct 2018 14:39:00 GMT

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

Alexei Scherbakov updated IGNITE-10088:
---------------------------------------
    Description: 
Reproducer:

{noformat}
package org.apache.ignite.internal.processors.cache.transactions;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.ignite.IgniteDataStreamer;
import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.DataRegionConfiguration;
import org.apache.ignite.configuration.DataStorageConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.failure.StopNodeFailureHandler;
import org.apache.ignite.failure.StopNodeOrHaltFailureHandler;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.TestRecordingCommunicationSpi;
import org.apache.ignite.internal.managers.communication.GridIoMessage;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxFinishRequest;
import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalRebalanceTest;
import org.apache.ignite.internal.processors.cache.verify.IdleVerifyResultV2;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.lang.IgniteBiPredicate;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
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 org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;

import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
import static org.apache.ignite.configuration.WALMode.LOG_ONLY;
import static org.apache.ignite.testframework.GridTestUtils.runAsync;
import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;

/**
 * Test data loss on recovery due to missed partition counter on tx messages reorder.
 */
public class TxMissedPartitionCounterTest extends GridCommonAbstractTest {
    /** IP finder. */
    private static final TcpDiscoveryVmIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);

    /** */
    private static final int GRID_CNT = 2;

    /** */
    private static final int MB = 1024 * 1024;

    /** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws
Exception {
        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

        cfg.setConsistentId("node" + igniteInstanceName);

        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);

        boolean client = igniteInstanceName.startsWith("client");

        cfg.setClientMode(client);

        cfg.setDataStorageConfiguration(new DataStorageConfiguration().
            setWalSegmentSize(12 * MB).setWalMode(LOG_ONLY).setPageSize(1024).setCheckpointFrequency(10000000000L).
            setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).
                setInitialSize(100 * MB).setMaxSize(100 * MB)));

        if (!client) {
            CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

            ccfg.setAtomicityMode(TRANSACTIONAL);
            ccfg.setBackups(2);
            ccfg.setWriteSynchronizationMode(FULL_SYNC);
            ccfg.setOnheapCacheEnabled(false);
            ccfg.setAffinity(new RendezvousAffinityFunction(false, 1));

            cfg.setCacheConfiguration(ccfg);
        }

        return cfg;
    }

    /** {@inheritDoc} */
    @Override protected void beforeTest() throws Exception {
        super.beforeTest();

        cleanPersistenceDir();
    }

    /** {@inheritDoc} */
    @Override protected void afterTest() throws Exception {
        super.afterTest();

        stopAllGrids();

        cleanPersistenceDir();
    }

    public void testMoving() throws Exception {
        IgniteEx crd = startGrid(0);

        startGrid(1);

        crd.cluster().active(true);

        awaitPartitionMapExchange();

        stopGrid(1);

        awaitPartitionMapExchange();

        startGrid(1); // Will trigger rebalance

        awaitPartitionMapExchange();
    }
}

{noformat}

  was:
Reproducer:

{noformat}
public void testMoving() throws Exception {
        IgniteEx crd = startGrid(0);

        startGrid(1);

        crd.cluster().active(true);

        awaitPartitionMapExchange();

        stopGrid(1);

        awaitPartitionMapExchange();

        startGrid(1);

        awaitPartitionMapExchange();
}
{noformat}


> Partition is restored in moving state instead of owning if node restarted before first
checkpoint.
> --------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-10088
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10088
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Alexei Scherbakov
>            Priority: Major
>
> Reproducer:
> {noformat}
> package org.apache.ignite.internal.processors.cache.transactions;
> import java.util.ArrayList;
> import java.util.List;
> import java.util.Map;
> import java.util.Set;
> import org.apache.ignite.IgniteDataStreamer;
> import org.apache.ignite.IgniteSystemProperties;
> import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
> import org.apache.ignite.cluster.ClusterNode;
> import org.apache.ignite.configuration.CacheConfiguration;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.failure.StopNodeFailureHandler;
> import org.apache.ignite.failure.StopNodeOrHaltFailureHandler;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.internal.IgniteInternalFuture;
> import org.apache.ignite.internal.TestRecordingCommunicationSpi;
> import org.apache.ignite.internal.managers.communication.GridIoMessage;
> import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxFinishRequest;
> import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalRebalanceTest;
> import org.apache.ignite.internal.processors.cache.verify.IdleVerifyResultV2;
> import org.apache.ignite.internal.util.typedef.T2;
> import org.apache.ignite.lang.IgniteBiPredicate;
> import org.apache.ignite.lang.IgnitePredicate;
> import org.apache.ignite.plugin.extensions.communication.Message;
> import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
> 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 org.apache.ignite.transactions.Transaction;
> import org.apache.ignite.transactions.TransactionConcurrency;
> import org.apache.ignite.transactions.TransactionIsolation;
> import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
> import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
> import static org.apache.ignite.configuration.WALMode.LOG_ONLY;
> import static org.apache.ignite.testframework.GridTestUtils.runAsync;
> import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
> import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
> /**
>  * Test data loss on recovery due to missed partition counter on tx messages reorder.
>  */
> public class TxMissedPartitionCounterTest extends GridCommonAbstractTest {
>     /** IP finder. */
>     private static final TcpDiscoveryVmIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
>     /** */
>     private static final int GRID_CNT = 2;
>     /** */
>     private static final int MB = 1024 * 1024;
>     /** {@inheritDoc} */
>     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName)
throws Exception {
>         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
>         cfg.setConsistentId("node" + igniteInstanceName);
>         ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
>         boolean client = igniteInstanceName.startsWith("client");
>         cfg.setClientMode(client);
>         cfg.setDataStorageConfiguration(new DataStorageConfiguration().
>             setWalSegmentSize(12 * MB).setWalMode(LOG_ONLY).setPageSize(1024).setCheckpointFrequency(10000000000L).
>             setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).
>                 setInitialSize(100 * MB).setMaxSize(100 * MB)));
>         if (!client) {
>             CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
>             ccfg.setAtomicityMode(TRANSACTIONAL);
>             ccfg.setBackups(2);
>             ccfg.setWriteSynchronizationMode(FULL_SYNC);
>             ccfg.setOnheapCacheEnabled(false);
>             ccfg.setAffinity(new RendezvousAffinityFunction(false, 1));
>             cfg.setCacheConfiguration(ccfg);
>         }
>         return cfg;
>     }
>     /** {@inheritDoc} */
>     @Override protected void beforeTest() throws Exception {
>         super.beforeTest();
>         cleanPersistenceDir();
>     }
>     /** {@inheritDoc} */
>     @Override protected void afterTest() throws Exception {
>         super.afterTest();
>         stopAllGrids();
>         cleanPersistenceDir();
>     }
>     public void testMoving() throws Exception {
>         IgniteEx crd = startGrid(0);
>         startGrid(1);
>         crd.cluster().active(true);
>         awaitPartitionMapExchange();
>         stopGrid(1);
>         awaitPartitionMapExchange();
>         startGrid(1); // Will trigger rebalance
>         awaitPartitionMapExchange();
>     }
> }
> {noformat}



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

Mime
View raw message