use of org.apache.ignite.configuration.DataStorageConfiguration.DFLT_WAL_PATH in project ignite by apache.
the class WalArchiveConsistencyTest method checkRecoveryWithoutWalTruncate.
/**
* Checking the consistency of recovery from a WAL when switching
* WAL archive off -> on and changing the number of segments on node restart.
* Without truncate WAL segments.
*
* @param segments Segment count on node restart.
* @throws Exception If failed.
*/
private void checkRecoveryWithoutWalTruncate(int segments) throws Exception {
IgniteEx n = startGrid(0, cfg -> {
cfg.getDataStorageConfiguration().setWalArchivePath(DFLT_WAL_PATH);
});
// Protection against deleting WAL segments.
assertTrue(walMgr(n).reserve(new WALPointer(0, 0, 0)));
AtomicInteger key = new AtomicInteger();
fill(n, 3, key);
forceCheckpoint();
// Guaranteed recovery from WAL segments.
dbMgr(n).enableCheckpoints(false).get(getTestTimeout());
fill(n, 3, key);
stopAllGrids();
n = startGrid(0, cfg -> {
cfg.getDataStorageConfiguration().setWalSegments(segments);
});
assertEquals(key.get(), n.cache(DEFAULT_CACHE_NAME).size());
}
Aggregations