Search in sources :

Example 46 with IgniteCacheDatabaseSharedManager

use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.

the class StandaloneWalRecordsIteratorTest method createWalFiles.

/**
 */
private String createWalFiles(int segRecCnt) throws Exception {
    IgniteEx ig = (IgniteEx) startGrid();
    String archiveWalDir = getArchiveWalDirPath(ig);
    ig.cluster().active(true);
    IgniteCacheDatabaseSharedManager sharedMgr = ig.context().cache().context().database();
    IgniteWriteAheadLogManager walMgr = ig.context().cache().context().wal();
    // Generate WAL segments for filling WAL archive folder.
    for (int i = 0; i < 2 * ig.configuration().getDataStorageConfiguration().getWalSegments(); i++) {
        sharedMgr.checkpointReadLock();
        try {
            for (int j = 0; j < segRecCnt - 1; j++) walMgr.log(new SnapshotRecord(i * segRecCnt + j, false));
            walMgr.log(new SnapshotRecord(i * segRecCnt + segRecCnt - 1, false), RolloverType.NEXT_SEGMENT);
        } finally {
            sharedMgr.checkpointReadUnlock();
        }
    }
    stopGrid();
    return archiveWalDir;
}
Also used : IgniteWriteAheadLogManager(org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager) IgniteEx(org.apache.ignite.internal.IgniteEx) SnapshotRecord(org.apache.ignite.internal.pagemem.wal.record.SnapshotRecord) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)

Example 47 with IgniteCacheDatabaseSharedManager

use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.

the class FailureHandlingConfigurationTest method testPartialCfgParamsPropagation.

/**
 * @throws Exception If failed.
 */
@Test
public void testPartialCfgParamsPropagation() throws Exception {
    sysWorkerBlockedTimeout = 30_000L;
    checkpointReadLockTimeout = null;
    IgniteEx ignite = startGrid(0);
    ignite.cluster().active(true);
    WorkersRegistry reg = ignite.context().workersRegistry();
    IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
    FailureHandlingMxBean mBean = getMBean();
    assertEquals(sysWorkerBlockedTimeout.longValue(), reg.getSystemWorkerBlockedTimeout());
    assertEquals(sysWorkerBlockedTimeout.longValue(), dbMgr.checkpointReadLockTimeout());
    assertEquals(sysWorkerBlockedTimeout.longValue(), mBean.getSystemWorkerBlockedTimeout());
    assertEquals(sysWorkerBlockedTimeout.longValue(), mBean.getCheckpointReadLockTimeout());
}
Also used : WorkersRegistry(org.apache.ignite.internal.worker.WorkersRegistry) FailureHandlingMxBean(org.apache.ignite.mxbean.FailureHandlingMxBean) IgniteEx(org.apache.ignite.internal.IgniteEx) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 48 with IgniteCacheDatabaseSharedManager

use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.

the class FailureHandlingConfigurationTest method testCfgParamsPropagation.

/**
 * @throws Exception If failed.
 */
@Test
public void testCfgParamsPropagation() throws Exception {
    sysWorkerBlockedTimeout = 30_000L;
    checkpointReadLockTimeout = 20_000L;
    IgniteEx ignite = startGrid(0);
    ignite.cluster().active(true);
    WorkersRegistry reg = ignite.context().workersRegistry();
    IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
    FailureHandlingMxBean mBean = getMBean();
    assertEquals(sysWorkerBlockedTimeout.longValue(), reg.getSystemWorkerBlockedTimeout());
    assertEquals(checkpointReadLockTimeout.longValue(), dbMgr.checkpointReadLockTimeout());
    assertEquals(sysWorkerBlockedTimeout.longValue(), mBean.getSystemWorkerBlockedTimeout());
    assertEquals(checkpointReadLockTimeout.longValue(), mBean.getCheckpointReadLockTimeout());
}
Also used : WorkersRegistry(org.apache.ignite.internal.worker.WorkersRegistry) FailureHandlingMxBean(org.apache.ignite.mxbean.FailureHandlingMxBean) IgniteEx(org.apache.ignite.internal.IgniteEx) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 49 with IgniteCacheDatabaseSharedManager

use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.

the class FailureHandlingConfigurationTest method testOverridingBySysProps.

/**
 * @throws Exception If failed.
 */
@Test
@WithSystemProperty(key = IGNITE_SYSTEM_WORKER_BLOCKED_TIMEOUT, value = "80000")
@WithSystemProperty(key = IGNITE_CHECKPOINT_READ_LOCK_TIMEOUT, value = "90000")
public void testOverridingBySysProps() throws Exception {
    sysWorkerBlockedTimeout = 1L;
    checkpointReadLockTimeout = 2L;
    IgniteEx ignite = startGrid(0);
    ignite.cluster().active(true);
    WorkersRegistry reg = ignite.context().workersRegistry();
    IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
    FailureHandlingMxBean mBean = getMBean();
    assertEquals(sysWorkerBlockedTimeout, ignite.configuration().getSystemWorkerBlockedTimeout());
    assertEquals(checkpointReadLockTimeout, ignite.configuration().getDataStorageConfiguration().getCheckpointReadLockTimeout());
    long workerPropVal = Long.getLong(IGNITE_SYSTEM_WORKER_BLOCKED_TIMEOUT);
    long checkpointPropVal = Long.getLong(IGNITE_CHECKPOINT_READ_LOCK_TIMEOUT);
    assertEquals(workerPropVal, reg.getSystemWorkerBlockedTimeout());
    assertEquals(checkpointPropVal, dbMgr.checkpointReadLockTimeout());
    assertEquals(workerPropVal, mBean.getSystemWorkerBlockedTimeout());
    assertEquals(checkpointPropVal, mBean.getCheckpointReadLockTimeout());
}
Also used : WorkersRegistry(org.apache.ignite.internal.worker.WorkersRegistry) FailureHandlingMxBean(org.apache.ignite.mxbean.FailureHandlingMxBean) IgniteEx(org.apache.ignite.internal.IgniteEx) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test) WithSystemProperty(org.apache.ignite.testframework.junits.WithSystemProperty)

Example 50 with IgniteCacheDatabaseSharedManager

use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.

the class FailureHandlingConfigurationTest method testNegativeParamValues.

/**
 * @throws Exception If failed.
 */
@Test
public void testNegativeParamValues() throws Exception {
    sysWorkerBlockedTimeout = -1L;
    checkpointReadLockTimeout = -85L;
    IgniteEx ignite = startGrid(0);
    ignite.cluster().active(true);
    WorkersRegistry reg = ignite.context().workersRegistry();
    IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
    FailureHandlingMxBean mBean = getMBean();
    assertEquals(0L, reg.getSystemWorkerBlockedTimeout());
    assertEquals(-85L, dbMgr.checkpointReadLockTimeout());
    assertEquals(0L, mBean.getSystemWorkerBlockedTimeout());
    assertEquals(-85L, mBean.getCheckpointReadLockTimeout());
}
Also used : WorkersRegistry(org.apache.ignite.internal.worker.WorkersRegistry) FailureHandlingMxBean(org.apache.ignite.mxbean.FailureHandlingMxBean) IgniteEx(org.apache.ignite.internal.IgniteEx) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

IgniteCacheDatabaseSharedManager (org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)58 Test (org.junit.Test)27 IgniteEx (org.apache.ignite.internal.IgniteEx)24 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)20 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)11 GridCacheSharedContext (org.apache.ignite.internal.processors.cache.GridCacheSharedContext)10 GridInternalSubscriptionProcessor (org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor)9 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)8 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)8 FullPageId (org.apache.ignite.internal.pagemem.FullPageId)8 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)7 GridSystemViewManager (org.apache.ignite.internal.managers.systemview.GridSystemViewManager)7 DirectMemoryProvider (org.apache.ignite.internal.mem.DirectMemoryProvider)7 IgniteWriteAheadLogManager (org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager)7 DataRegionMetricsImpl (org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)7 IgnitePluginProcessor (org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor)6 GridTestKernalContext (org.apache.ignite.testframework.junits.GridTestKernalContext)6 HashMap (java.util.HashMap)5 GridEncryptionManager (org.apache.ignite.internal.managers.encryption.GridEncryptionManager)5 JmxSystemViewExporterSpi (org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi)5