[
https://issues.apache.org/jira/browse/IGNITE-8116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16432708#comment-16432708
]
ASF GitHub Bot commented on IGNITE-8116:
----------------------------------------
GitHub user Jokser opened a pull request:
https://github.com/apache/ignite/pull/3791
IGNITE-8116 Historical rebalance fixes
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gridgain/apache-ignite ignite-8116-8122
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ignite/pull/3791.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3791
----
commit 604ee719b304d0b4cf4caabaa6fa16b5a980e04e
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-04T09:33:10Z
IGNITE-8122 Restore partition state to OWNING if unable to read from page
memory.
commit c43c598916bd9bda2f624a214cefcc28b0380a5c
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-05T14:26:53Z
IGNITE-8122 Restore partitions when persistence is enabled with OWNING
default state.
commit a061cdba3a46f5384910fecf89366101f904ccdf
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-05T14:50:20Z
IGNITE-8122 Move OWN logic to GridDhtLocalPartition constructor.
commit 9259407a462633a68de6dcd7d3ae135c8c7c0b37
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-05T17:15:39Z
IGNITE-8122 Docs.
commit 20979dc4874cfeca649b29d8827d522f3e57ee67
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-05T17:16:54Z
Merge branch 'master' into ignite-8122
commit 791ef918335e66d274a10c2b5d21c9da1c212a0b
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-06T12:53:21Z
IGNITE-8122 Restore partition in OWNING state correctly.
commit 56bdb20513731f49bf3a2b51f672396efc16bfe1
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-09T11:42:59Z
IGNITE-8122 Restore partition states on before exchange in case of starting
cache group.
commit dcea5b47a5a08f165930a2e0235ecf51385f4997
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-09T11:55:53Z
IGNITE-8122 Fixed test with auto-activation.
commit 915788c7ea25f04ccacfa06e1f19c06c92f7c141
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-09T15:32:59Z
IGNITE-8116 WIP
commit d224cd5663415dc8636f6ba01bfd5002fdb35a3e
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-10T10:59:20Z
Merge branch 'ignite-8122' into ignite-8116-8122
commit e988272e57760ee44753314ad8db2adab344a6c0
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-10T11:47:04Z
IGNITE-8116 WIP
commit bd53648935b24fb2c68a885db81656f2d960ba1e
Author: Pavel Kovalenko <jokserfn@...>
Date: 2018-04-10T18:09:32Z
IGNITE-8116 WAL rebalance issues.
----
> Historic WAL rebalance fails
> ----------------------------
>
> Key: IGNITE-8116
> URL: https://issues.apache.org/jira/browse/IGNITE-8116
> Project: Ignite
> Issue Type: Bug
> Components: persistence
> Reporter: Eduard Shangareev
> Assignee: Pavel Kovalenko
> Priority: Critical
> Fix For: 2.5
>
>
> So, my reproducer fails because rebalance is never completed.
> Rebalance fails with next error:
> {code}
> Exception in thread "sys-#95%wal.IgniteWalRebalanceTest0%"
> java.lang.AssertionError
> at
> org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplier.handleDemandMessage(GridDhtPartitionSupplier.java:390)
> at
> org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader.handleDemandMessage(GridDhtPreloader.java:364)
> at
> org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$5.apply(GridCachePartitionExchangeManager.java:372)
> at
> org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$5.apply(GridCachePartitionExchangeManager.java:357)
> at
> org.apache.ignite.internal.processors.cache.GridCacheIoManager.processMessage(GridCacheIoManager.java:1054)
> at
> org.apache.ignite.internal.processors.cache.GridCacheIoManager.onMessage0(GridCacheIoManager.java:579)
> at
> org.apache.ignite.internal.processors.cache.GridCacheIoManager.access$700(GridCacheIoManager.java:99)
> at
> org.apache.ignite.internal.processors.cache.GridCacheIoManager$OrderedMessageListener.onMessage(GridCacheIoManager.java:1603)
> at
> org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1556)
> at
> org.apache.ignite.internal.managers.communication.GridIoManager.access$4100(GridIoManager.java:125)
> at
> org.apache.ignite.internal.managers.communication.GridIoManager$GridCommunicationMessageSet.unwind(GridIoManager.java:2752)
> at
> org.apache.ignite.internal.managers.communication.GridIoManager.unwindMessageSet(GridIoManager.java:1516)
> at
> org.apache.ignite.internal.managers.communication.GridIoManager.access$4400(GridIoManager.java:125)
> at
> org.apache.ignite.internal.managers.communication.GridIoManager$10.run(GridIoManager.java:1485)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> Reproducer:
> {code}
> /*
> * 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.persistence.db.wal;
> import java.util.concurrent.TimeUnit;
> import org.apache.ignite.IgniteCache;
> import org.apache.ignite.cache.CacheAtomicityMode;
> import org.apache.ignite.cache.CacheMode;
> import org.apache.ignite.cache.CacheRebalanceMode;
> import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
> import org.apache.ignite.cache.query.annotations.QuerySqlField;
> 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.configuration.WALMode;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.internal.util.typedef.internal.S;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import static
> org.apache.ignite.IgniteSystemProperties.IGNITE_PDS_WAL_REBALANCE_THRESHOLD;
> /**
> * Historic WAL rebalance test
> */
> public class IgniteWalRebalanceTest extends GridCommonAbstractTest {
> /** Cache name. */
> private static final String CACHE_NAME = "cache";
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String gridName)
> throws Exception {
> System.setProperty(IGNITE_PDS_WAL_REBALANCE_THRESHOLD, "0"); //to
> make all rebalance wal-based
> IgniteConfiguration cfg = super.getConfiguration(gridName);
> CacheConfiguration<Integer, IndexedObject> ccfg = new
> CacheConfiguration<>(CACHE_NAME);
> ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
> ccfg.setRebalanceMode(CacheRebalanceMode.ASYNC);
> ccfg.setCacheMode(CacheMode.REPLICATED);
> ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
> cfg.setCacheConfiguration(ccfg);
> DataStorageConfiguration dbCfg = new DataStorageConfiguration()
> .setWalHistorySize(Integer.MAX_VALUE)
> .setWalMode(WALMode.LOG_ONLY)
> .setDefaultDataRegionConfiguration(new
> DataRegionConfiguration().setPersistenceEnabled(true));
> cfg.setDataStorageConfiguration(dbCfg);
> return cfg;
> }
> /** {@inheritDoc} */
> @Override protected void beforeTest() throws Exception {
> stopAllGrids();
> cleanPersistenceDir();
> }
> /** {@inheritDoc} */
> @Override protected void afterTest() throws Exception {
> System.clearProperty(IGNITE_PDS_WAL_REBALANCE_THRESHOLD);
> stopAllGrids();
> cleanPersistenceDir();
> }
> /**
> * @throws Exception if failed.
> */
> public void test() throws Exception {
> IgniteEx ig0 = startGrid(0);
> IgniteEx ig1 = startGrid(1);
> final int entryCnt = 10_000;
> ig0.cluster().active(true);
> IgniteCache<Object, Object> cache = ig0.cache(CACHE_NAME);
> for (int k = 0; k < entryCnt; k++)
> cache.put(k, new IndexedObject(k));
> forceCheckpoint();
> stopGrid(1, false);
> for (int k = 0; k < entryCnt; k++)
> cache.put(k, new IndexedObject(k + 1));
> forceCheckpoint();
> ig1 = startGrid(1);
> IgniteCache<Object, Object> cache1 = ig1.cache(CACHE_NAME);
> cache1.rebalance().get(2, TimeUnit.MINUTES);
> for (int k = 0; k < entryCnt; k++)
> assertEquals(new IndexedObject(k + 1), cache.get(k));
> }
> /**
> *
> */
> private static class IndexedObject {
> /** */
> @QuerySqlField(index = true)
> private int iVal;
> /** */
> private byte[] payload = new byte[1024];
> /**
> * @param iVal Integer value.
> */
> private IndexedObject(int iVal) {
> this.iVal = iVal;
> }
> /** {@inheritDoc} */
> @Override public boolean equals(Object o) {
> if (this == o)
> return true;
> if (!(o instanceof IndexedObject))
> return false;
> IndexedObject that = (IndexedObject)o;
> return iVal == that.iVal;
> }
> /** {@inheritDoc} */
> @Override public int hashCode() {
> return iVal;
> }
> /** {@inheritDoc} */
> @Override public String toString() {
> return S.toString(IndexedObject.class, this);
> }
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)