public void testStateTransfer() throws Exception { final int numKeys = 300; for (int i = 0; i < numKeys; i++) { cache(0).put(i, i); } log.info("Finished putting keys"); for (int i = 0; i < numKeys; i++) { assertEquals(i, cache(0).get(i)); } log.info("Adding a new node .."); builder.persistence().clearStores().addSingleFileStore().location(new File(tmpDir, "store1").getAbsolutePath()) // make sure this node writes in a different location .fetchPersistentState(true) .ignoreModifications(false) .purgeOnStartup(false); addClusterEnabledCacheManager(builder); log.info("Added a new node"); for (int i = 0; i < numKeys; i++) { assertEquals(i, cache(1).get(i)); // some keys are lost in 5.2 } } }
@Override protected void createCacheManagers() { tmpDir = new File(TestingUtil.tmpDirectory(this.getClass())); Util.recursiveFileRemove(tmpDir); // reproduce the MODE-1754 config as closely as possible builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true, true); builder.transaction().transactionMode(TransactionMode.TRANSACTIONAL).lockingMode(LockingMode.PESSIMISTIC) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .memory().size(1000) .locking().lockAcquisitionTimeout(20000) .concurrencyLevel(5000) // lowering this to 50 makes the test pass also on 5.2 but it's just a temporary workaround .useLockStriping(false).isolationLevel(IsolationLevel.READ_COMMITTED) .dataContainer().storeAsBinary() .clustering().remoteTimeout(20000) .stateTransfer().timeout(240000).fetchInMemoryState(false).chunkSize(10000) .persistence().passivation(false).addSingleFileStore().location(new File(tmpDir, "store0").getAbsolutePath()).shared(false).preload(false) .fetchPersistentState(true) .ignoreModifications(false) .purgeOnStartup(false); createCluster(builder, 1); waitForClusterToForm(); }
public void testDocumentationPersistenceConfiguration() { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.persistence() .passivation(false) .addSingleFileStore() .fetchPersistentState(true) .shared(false) .preload(true) .ignoreModifications(false) .purgeOnStartup(false) .location(System.getProperty("java.io.tmpdir")) .async() .enabled(true) .flushLockTimeout(15000) .threadPoolSize(5) .singleton() .enabled(true) .pushStateWhenCoordinator(true) .pushStateTimeout(20000); }