Search in sources :

Example 6 with ValidateIndexesClosure

use of org.apache.ignite.internal.visor.verify.ValidateIndexesClosure in project ignite by apache.

the class RebuildIndexWithHistoricalRebalanceTest method shouldRebuldIndexForMovingPartitionWithHistoricalRebalance.

/**
 */
@Test
// Use only historical rebalance
@WithSystemProperty(key = IGNITE_PDS_WAL_REBALANCE_THRESHOLD, value = "0")
public void shouldRebuldIndexForMovingPartitionWithHistoricalRebalance() throws Exception {
    IgniteEx node1 = startGrid(0);
    startGrid(1);
    node1.cluster().active(true);
    IgniteCache<UserKey, UserValue> cache = node1.getOrCreateCache(CACHE_NAME);
    cache.put(new UserKey(1), new UserValue(333));
    stopGrid(1);
    cache.put(new UserKey(2), new UserValue(555));
    SUPPLY_MESSAGE_LATCH.set(new CountDownLatch(1));
    removeIndexBin(1);
    LogListener rebuildLsnr = finishIndexRebuildLsnr(CACHE_NAME);
    IgniteEx node2 = startGrid(1);
    assertTrue(GridTestUtils.waitForCondition(rebuildLsnr::check, 10_000));
    SUPPLY_MESSAGE_LATCH.get().countDown();
    awaitPartitionMapExchange();
    ValidateIndexesClosure clo = new ValidateIndexesClosure(() -> false, Collections.singleton(CACHE_NAME), 0, 0, false, true);
    node2.context().resource().injectGeneric(clo);
    VisorValidateIndexesJobResult res = clo.call();
    assertFalse(res.hasIssues());
}
Also used : LogListener(org.apache.ignite.testframework.LogListener) IgniteEx(org.apache.ignite.internal.IgniteEx) VisorValidateIndexesJobResult(org.apache.ignite.internal.visor.verify.VisorValidateIndexesJobResult) ValidateIndexesClosure(org.apache.ignite.internal.visor.verify.ValidateIndexesClosure) CountDownLatch(java.util.concurrent.CountDownLatch) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test) WithSystemProperty(org.apache.ignite.testframework.junits.WithSystemProperty)

Aggregations

ValidateIndexesClosure (org.apache.ignite.internal.visor.verify.ValidateIndexesClosure)6 IgniteEx (org.apache.ignite.internal.IgniteEx)5 Test (org.junit.Test)4 VisorValidateIndexesJobResult (org.apache.ignite.internal.visor.verify.VisorValidateIndexesJobResult)3 LogListener (org.apache.ignite.testframework.LogListener)3 ListeningTestLogger (org.apache.ignite.testframework.ListeningTestLogger)2 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)2 List (java.util.List)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Ignite (org.apache.ignite.Ignite)1 IgniteCache (org.apache.ignite.IgniteCache)1 IgniteException (org.apache.ignite.IgniteException)1 IgniteInternalFuture (org.apache.ignite.internal.IgniteInternalFuture)1 WithSystemProperty (org.apache.ignite.testframework.junits.WithSystemProperty)1