private int currentTopologyId(Cache cache) { return TestingUtil.extractComponent(cache, DistributionManager.class).getCacheTopology().getTopologyId(); } }
private int currentTopologyId(Cache cache) { return cache.getAdvancedCache().getDistributionManager().getCacheTopology().getTopologyId(); }
private int currentTopologyId(Cache cache) { return cache.getAdvancedCache().getDistributionManager().getCacheTopology().getTopologyId(); }
@Override public Object visitGetCacheEntryCommand(InvocationContext ctx, GetCacheEntryCommand command) throws Throwable { assertNotNull(stateTransferLock); log.tracef("Waiting for topology %d before executing %s", expectedTopologyId, command); CompletableFuture<Void> topologyFuture = stateTransferLock.topologyFuture(expectedTopologyId); if (topologyFuture != null) { topologyFuture.get(10, TimeUnit.SECONDS); } assertEquals(expectedTopologyId, distributionManager.getCacheTopology().getTopologyId()); return invokeNext(ctx, command); } }
public void testMinViewId1() throws Exception { final TransactionTable tt0 = TestingUtil.getTransactionTable(cache(0)); final TransactionTable tt1 = TestingUtil.getTransactionTable(cache(1)); DistributionManager distributionManager0 = advancedCache(0).getDistributionManager(); final int topologyId = distributionManager0.getCacheTopology().getTopologyId(); assertEquals(tt0.getMinTopologyId(), topologyId); assertEquals(tt1.getMinTopologyId(), topologyId); //add a new cache and check that min view is updated log.trace("Adding new node .."); addClusterEnabledCacheManager(c); waitForClusterToForm(); log.trace("New node added."); final int topologyId2 = distributionManager0.getCacheTopology().getTopologyId(); assertTrue(topologyId2 > topologyId); final TransactionTable tt2 = TestingUtil.getTransactionTable(cache(2)); eventually(() -> tt0.getMinTopologyId() == topologyId2 && tt1.getMinTopologyId() == topologyId2 && tt2.getMinTopologyId() == topologyId2); }
int currentTopologyId = cacheTopology.getTopologyId(); if (commandTopologyId != -1 && currentTopologyId != commandTopologyId) { throw OutdatedTopologyException.RETRY_NEXT_TOPOLOGY;
public void testNodeJoin() throws Exception { List<MagicKey> keys = init(); EmbeddedCacheManager cm4 = addClusterEnabledCacheManager(defaultConfig, TRANSPORT_FLAGS); int startTopologyId = c1.getAdvancedCache().getDistributionManager().getCacheTopology().getTopologyId();
final int topologyId = distributionManager0.getCacheTopology().getTopologyId(); log.trace("New node added."); final int topologyId2 = distributionManager0.getCacheTopology().getTopologyId(); assertTrue(topologyId2 > topologyId);
BlockingClusterTopologyManager bctm = BlockingClusterTopologyManager.replace(c.getCacheManager()); BlockingClusterTopologyManager.Handle<CacheTopology> handle = bctm.startBlockingTopologyUpdate(topology -> true); int currentTopology = cr.getDistributionManager().getCacheTopology().getTopologyId(); cleanup.add(handle::stopBlocking);
int initialTopologyId = dm0.getCacheTopology().getTopologyId(); int rebalanceTopologyId = initialTopologyId + 1; AdvancedCache<Object, Object> cache1 = advancedCache(1, CACHE_NAME);
private Future<Void> simulateTopologyUpdate(Cache<Object, Object> cache) { StateTransferLock stl4 = TestingUtil.extractComponent(cache, StateTransferLock.class); DistributionManager dm4 = cache.getAdvancedCache().getDistributionManager(); LocalizedCacheTopology cacheTopology = dm4.getCacheTopology(); int newTopologyId = cacheTopology.getTopologyId() + 1; CacheTopology newTopology = new CacheTopology(newTopologyId, cacheTopology.getRebalanceId(), cacheTopology.getCurrentCH(), cacheTopology.getPendingCH(), cacheTopology.getUnionCH(), cacheTopology.getPhase(), cacheTopology.getActualMembers(), cacheTopology.getMembersPersistentUUIDs()); dm4.setCacheTopology(newTopology); return fork(() -> stl4.notifyTransactionDataReceived(newTopologyId)); } }
int preJoinTopologyId = cache0.getDistributionManager().getCacheTopology().getTopologyId();
int currentTopologyId = primaryOwnerCache.getAdvancedCache().getDistributionManager().getCacheTopology().getTopologyId(); Future<Object> secondCommitFuture = fork(() -> {
public void testNewTopologySentAfterCleanMerge() { TestingUtil.waitForNoRebalanceAcrossManagers(managers()); int initialTopology = advancedCache(0).getRpcManager().getTopologyId(); expectCompleteTopology(client, initialTopology); PartitionDescriptor p0 = new PartitionDescriptor(0); PartitionDescriptor p1 = new PartitionDescriptor(1); splitCluster(p0.getNodes(), p1.getNodes()); eventuallyEquals(1, () -> advancedCache(0).getDistributionManager().getCacheTopology().getActualMembers().size()); eventuallyEquals(1, () -> advancedCache(1).getDistributionManager().getCacheTopology().getActualMembers().size()); expectPartialTopology(client, initialTopology + 1); partition(0).merge(partition(1)); int finalTopologyId = initialTopology + (partitionHandling == PartitionHandling.DENY_READ_WRITES ? 4 : 8); eventuallyExpectCompleteTopology(client, finalTopologyId); // Check that we got the number of topology updates to NO_REBALANCE right // With DENY_READ_WRITES: // T+1: DEGRADED_MODE in both partitions // T+3: merged, still DEGRADED_MODE // T+4: back to AVAILABLE // With ALLOW_READ_WRITES: // T+2: NO_REBALANCE in partition [B] before merge // T+3: CONFLICT_RESOLUTION, preferred CH: owners = (1) [test-NodeA-22368: 256+0] // T+4: NO_REBALANCE update topology after CR and before rebalance begins // T+5:READ_OLD (rebalance starts), T+6:READ_ALL, T+7:READ_NEW, T+8: NO_REBALANCE LocalizedCacheTopology newTopology = advancedCache(0).getDistributionManager().getCacheTopology(); assertEquals(CacheTopology.Phase.NO_REBALANCE, newTopology.getPhase()); assertEquals(finalTopologyId, newTopology.getTopologyId()); }
DistributionManager dm0 = cache0.getDistributionManager(); int initialTopologyId = dm0.getCacheTopology().getTopologyId(); int rebalanceTopologyId = initialTopologyId + 1; final int finalTopologyId = rebalanceTopologyId + 3; assertEquals(rebalanceTopologyId, dm0.getCacheTopology().getTopologyId()); assertEquals(finalTopologyId, dm0.getCacheTopology().getTopologyId());
final int initialTopologyId = dm0.getCacheTopology().getTopologyId();
checkPoint.trigger("allow_topology_" + postJoinTopologyId + "_on_" + address(0)); eventuallyEquals(postJoinTopologyId, () -> cache0.getDistributionManager().getCacheTopology().getTopologyId());
final Cache<Object, Object> c1 = cm1.getCache(); DelayInterceptor di1 = findInterceptor(c1, DelayInterceptor.class); int initialTopologyId = c1.getAdvancedCache().getDistributionManager().getCacheTopology().getTopologyId();
final Cache<Object, Object> c1 = cm1.getCache(); DelayInterceptor di1 = findInterceptor(c1, DelayInterceptor.class); int initialTopologyId = c1.getAdvancedCache().getDistributionManager().getCacheTopology().getTopologyId();
final Cache<Object, Object> c1 = cm1.getCache(); DelayInterceptor di1 = findInterceptor(c1, DelayInterceptor.class); int initialTopologyId = c1.getAdvancedCache().getDistributionManager().getCacheTopology().getTopologyId();