public void forceNewerGeneration() { EndpointState epstate = endpointStateMap.get(FBUtilities.getBroadcastAddress()); epstate.getHeartBeatState().forceNewerGenerationUnsafe(); }
public void forceNewerGeneration() { EndpointState epstate = endpointStateMap.get(FBUtilities.getBroadcastAddress()); epstate.getHeartBeatState().forceNewerGenerationUnsafe(); }
public void forceNewerGeneration() { EndpointState epstate = endpointStateMap.get(FBUtilities.getBroadcastAddress()); epstate.getHeartBeatState().forceNewerGenerationUnsafe(); }
public void forceNewerGeneration() { EndpointState epstate = endpointStateMap.get(FBUtilities.getBroadcastAddress()); epstate.getHeartBeatState().forceNewerGenerationUnsafe(); }
/** * Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN * This should only be called after advertiseRemoving * * @param endpoint * @param hostId */ public void advertiseTokenRemoved(InetAddress endpoint, UUID hostId) { EndpointState epState = endpointStateMap.get(endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); long expireTime = computeExpireTime(); epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId, expireTime)); logger.info("Completing removal of {}", endpoint); addExpireTimeForEndpoint(endpoint, expireTime); endpointStateMap.put(endpoint, epState); // ensure at least one gossip round occurs before returning Uninterruptibles.sleepUninterruptibly(intervalInMillis * 2, TimeUnit.MILLISECONDS); }
/** * This method will begin removing an existing endpoint from the cluster by spoofing its state * This should never be called unless this coordinator has had 'removenode' invoked * * @param endpoint - the endpoint being removed * @param hostId - the ID of the host being removed * @param localHostId - my own host ID for replication coordination */ public void advertiseRemoving(InetAddress endpoint, UUID hostId, UUID localHostId) { EndpointState epState = endpointStateMap.get(endpoint); // remember this node's generation int generation = epState.getHeartBeatState().getGeneration(); logger.info("Removing host: {}", hostId); logger.info("Sleeping for {}ms to ensure {} does not change", StorageService.RING_DELAY, endpoint); Uninterruptibles.sleepUninterruptibly(StorageService.RING_DELAY, TimeUnit.MILLISECONDS); // make sure it did not change epState = endpointStateMap.get(endpoint); if (epState.getHeartBeatState().getGeneration() != generation) throw new RuntimeException("Endpoint " + endpoint + " generation changed while trying to remove it"); // update the other node's generation to mimic it as if it had changed it itself logger.info("Advertising removal for {}", endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); Map<ApplicationState, VersionedValue> states = new EnumMap<>(ApplicationState.class); states.put(ApplicationState.STATUS, StorageService.instance.valueFactory.removingNonlocal(hostId)); states.put(ApplicationState.REMOVAL_COORDINATOR, StorageService.instance.valueFactory.removalCoordinator(localHostId)); epState.addApplicationStates(states); endpointStateMap.put(endpoint, epState); }
/** * This method will begin removing an existing endpoint from the cluster by spoofing its state * This should never be called unless this coordinator has had 'removenode' invoked * * @param endpoint - the endpoint being removed * @param hostId - the ID of the host being removed * @param localHostId - my own host ID for replication coordination */ public void advertiseRemoving(InetAddress endpoint, UUID hostId, UUID localHostId) { EndpointState epState = endpointStateMap.get(endpoint); // remember this node's generation int generation = epState.getHeartBeatState().getGeneration(); logger.info("Removing host: {}", hostId); logger.info("Sleeping for {}ms to ensure {} does not change", StorageService.RING_DELAY, endpoint); Uninterruptibles.sleepUninterruptibly(StorageService.RING_DELAY, TimeUnit.MILLISECONDS); // make sure it did not change epState = endpointStateMap.get(endpoint); if (epState.getHeartBeatState().getGeneration() != generation) throw new RuntimeException("Endpoint " + endpoint + " generation changed while trying to remove it"); // update the other node's generation to mimic it as if it had changed it itself logger.info("Advertising removal for {}", endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); Map<ApplicationState, VersionedValue> states = new EnumMap<>(ApplicationState.class); states.put(ApplicationState.STATUS, StorageService.instance.valueFactory.removingNonlocal(hostId)); states.put(ApplicationState.REMOVAL_COORDINATOR, StorageService.instance.valueFactory.removalCoordinator(localHostId)); epState.addApplicationStates(states); endpointStateMap.put(endpoint, epState); }
/** * Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN * This should only be called after advertiseRemoving * * @param endpoint * @param hostId */ public void advertiseTokenRemoved(InetAddress endpoint, UUID hostId) { EndpointState epState = endpointStateMap.get(endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); long expireTime = computeExpireTime(); epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId, expireTime)); logger.info("Completing removal of {}", endpoint); addExpireTimeForEndpoint(endpoint, expireTime); endpointStateMap.put(endpoint, epState); // ensure at least one gossip round occurs before returning Uninterruptibles.sleepUninterruptibly(intervalInMillis * 2, TimeUnit.MILLISECONDS); }
/** * This method will begin removing an existing endpoint from the cluster by spoofing its state * This should never be called unless this coordinator has had 'removenode' invoked * * @param endpoint - the endpoint being removed * @param hostId - the ID of the host being removed * @param localHostId - my own host ID for replication coordination */ public void advertiseRemoving(InetAddress endpoint, UUID hostId, UUID localHostId) { EndpointState epState = endpointStateMap.get(endpoint); // remember this node's generation int generation = epState.getHeartBeatState().getGeneration(); logger.info("Removing host: {}", hostId); logger.info("Sleeping for {}ms to ensure {} does not change", StorageService.RING_DELAY, endpoint); Uninterruptibles.sleepUninterruptibly(StorageService.RING_DELAY, TimeUnit.MILLISECONDS); // make sure it did not change epState = endpointStateMap.get(endpoint); if (epState.getHeartBeatState().getGeneration() != generation) throw new RuntimeException("Endpoint " + endpoint + " generation changed while trying to remove it"); // update the other node's generation to mimic it as if it had changed it itself logger.info("Advertising removal for {}", endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); Map<ApplicationState, VersionedValue> states = new EnumMap<>(ApplicationState.class); states.put(ApplicationState.STATUS, StorageService.instance.valueFactory.removingNonlocal(hostId)); states.put(ApplicationState.REMOVAL_COORDINATOR, StorageService.instance.valueFactory.removalCoordinator(localHostId)); epState.addApplicationStates(states); endpointStateMap.put(endpoint, epState); }
/** * This method will begin removing an existing endpoint from the cluster by spoofing its state * This should never be called unless this coordinator has had 'removenode' invoked * * @param endpoint - the endpoint being removed * @param hostId - the ID of the host being removed * @param localHostId - my own host ID for replication coordination */ public void advertiseRemoving(InetAddress endpoint, UUID hostId, UUID localHostId) { EndpointState epState = endpointStateMap.get(endpoint); // remember this node's generation int generation = epState.getHeartBeatState().getGeneration(); logger.info("Removing host: {}", hostId); logger.info("Sleeping for {}ms to ensure {} does not change", StorageService.RING_DELAY, endpoint); Uninterruptibles.sleepUninterruptibly(StorageService.RING_DELAY, TimeUnit.MILLISECONDS); // make sure it did not change epState = endpointStateMap.get(endpoint); if (epState.getHeartBeatState().getGeneration() != generation) throw new RuntimeException("Endpoint " + endpoint + " generation changed while trying to remove it"); // update the other node's generation to mimic it as if it had changed it itself logger.info("Advertising removal for {}", endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); Map<ApplicationState, VersionedValue> states = new EnumMap<>(ApplicationState.class); states.put(ApplicationState.STATUS, StorageService.instance.valueFactory.removingNonlocal(hostId)); states.put(ApplicationState.REMOVAL_COORDINATOR, StorageService.instance.valueFactory.removalCoordinator(localHostId)); epState.addApplicationStates(states); endpointStateMap.put(endpoint, epState); }
/** * Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN * This should only be called after advertiseRemoving * * @param endpoint * @param hostId */ public void advertiseTokenRemoved(InetAddress endpoint, UUID hostId) { EndpointState epState = endpointStateMap.get(endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); long expireTime = computeExpireTime(); epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId, expireTime)); logger.info("Completing removal of {}", endpoint); addExpireTimeForEndpoint(endpoint, expireTime); endpointStateMap.put(endpoint, epState); // ensure at least one gossip round occurs before returning Uninterruptibles.sleepUninterruptibly(intervalInMillis * 2, TimeUnit.MILLISECONDS); }
/** * Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN * This should only be called after advertiseRemoving * * @param endpoint * @param hostId */ public void advertiseTokenRemoved(InetAddress endpoint, UUID hostId) { EndpointState epState = endpointStateMap.get(endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); long expireTime = computeExpireTime(); epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId, expireTime)); logger.info("Completing removal of {}", endpoint); addExpireTimeForEndpoint(endpoint, expireTime); endpointStateMap.put(endpoint, epState); // ensure at least one gossip round occurs before returning Uninterruptibles.sleepUninterruptibly(intervalInMillis * 2, TimeUnit.MILLISECONDS); }
throw new RuntimeException("Endpoint still alive: " + endpoint + " heartbeat changed while trying to assassinate it"); epState.getHeartBeatState().forceNewerGenerationUnsafe();
throw new RuntimeException("Endpoint still alive: " + endpoint + " heartbeat changed while trying to assassinate it"); epState.getHeartBeatState().forceNewerGenerationUnsafe();
throw new RuntimeException("Endpoint " + endpoint + " generation changed while trying to remove it"); epState.getHeartBeatState().forceNewerGenerationUnsafe();
throw new RuntimeException("Endpoint still alive: " + endpoint + " heartbeat changed while trying to assassinate it"); epState.getHeartBeatState().forceNewerGenerationUnsafe();