use of com.hazelcast.spi.exception.TargetNotMemberException in project hazelcast by hazelcast.
the class MigrationManager method logMigrationCommitFailure.
private void logMigrationCommitFailure(MigrationInfo migration, Throwable t) {
boolean memberLeft = t instanceof MemberLeftException || t.getCause() instanceof TargetNotMemberException || t.getCause() instanceof HazelcastInstanceNotActiveException;
PartitionReplica destination = migration.getDestination();
if (memberLeft) {
if (destination.isIdentical(node.getLocalMember())) {
logger.fine("Migration commit failed for " + migration + " since this node is shutting down.");
return;
}
logger.warning("Migration commit failed for " + migration + " since destination " + destination + " left the cluster");
} else {
logger.severe("Migration commit to " + destination + " failed for " + migration, t);
}
}
use of com.hazelcast.spi.exception.TargetNotMemberException in project hazelcast by hazelcast.
the class FrozenPartitionTableTest method partitionTable_shouldBeFixed_whenMemberRestarts_usingUuidOfAnotherMissingMember.
@Test
public void partitionTable_shouldBeFixed_whenMemberRestarts_usingUuidOfAnotherMissingMember() {
ruleStaleJoinPreventionDuration.setOrClearProperty("5");
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory();
HazelcastInstance hz1 = factory.newHazelcastInstance();
HazelcastInstance hz2 = factory.newHazelcastInstance();
HazelcastInstance hz3 = factory.newHazelcastInstance();
HazelcastInstance hz4 = factory.newHazelcastInstance();
assertClusterSizeEventually(4, hz2, hz3);
warmUpPartitions(hz1, hz2, hz3, hz4);
changeClusterStateEventually(hz4, ClusterState.FROZEN);
int member3PartitionId = getPartitionId(hz3);
int member4PartitionId = getPartitionId(hz4);
MemberImpl member3 = getNode(hz3).getLocalMember();
MemberImpl member4 = getNode(hz4).getLocalMember();
hz3.shutdown();
hz4.shutdown();
assertClusterSizeEventually(2, hz1, hz2);
newHazelcastInstance(initOrCreateConfig(new Config()), randomName(), new StaticMemberNodeContext(factory, member4.getUuid(), member3.getAddress()));
assertClusterSizeEventually(3, hz1, hz2);
waitAllForSafeState(hz1, hz2);
OperationServiceImpl operationService = getOperationService(hz1);
operationService.invokeOnPartition(null, new NonRetryablePartitionOperation(), member3PartitionId).join();
try {
operationService.invokeOnPartition(null, new NonRetryablePartitionOperation(), member4PartitionId).joinInternal();
fail("Invocation to missing member should have failed!");
} catch (TargetNotMemberException ignored) {
}
}
use of com.hazelcast.spi.exception.TargetNotMemberException in project hazelcast by hazelcast.
the class ChainingFutureTest method testTopologyChangesExceptionsAreIgnored.
@Test
public void testTopologyChangesExceptionsAreIgnored() {
InternalCompletableFuture<Object> future1 = newFuture();
InternalCompletableFuture<Object> future2 = newFuture();
InternalCompletableFuture<Object> future3 = newFuture();
CountingIterator<InternalCompletableFuture<Object>> iterator = toIterator(future1, future2, future3);
ChainingFuture.ExceptionHandler handler = repairingIterator;
ChainingFuture<Object> future = new ChainingFuture<>(iterator, handler);
assertEquals(1, iterator.getHasNextCounter());
assertEquals(1, iterator.getNextCounter());
assertFalse(future.isDone());
future1.complete(new MemberLeftException("this should be ignored"));
assertEquals(2, iterator.getHasNextCounter());
assertEquals(2, iterator.getNextCounter());
assertFalse(future.isDone());
future2.complete(new TargetNotMemberException("this should be ignored"));
assertEquals(3, iterator.getHasNextCounter());
assertEquals(3, iterator.getNextCounter());
assertFalse(future.isDone());
future3.complete("foo");
assertTrue(future.isDone());
assertEquals(4, iterator.getHasNextCounter());
assertEquals(3, iterator.getNextCounter());
}
use of com.hazelcast.spi.exception.TargetNotMemberException in project hazelcast by hazelcast.
the class ClientSmartInvocationServiceImpl method invokeOnTarget.
@Override
public void invokeOnTarget(ClientInvocation invocation, Address target) throws IOException {
if (target == null) {
throw new NullPointerException("Target can not be null");
}
if (!isMember(target)) {
throw new TargetNotMemberException("Target : " + target + " is not member. ");
}
final Connection connection = getOrTriggerConnect(target);
invokeOnConnection(invocation, (ClientConnection) connection);
}
use of com.hazelcast.spi.exception.TargetNotMemberException in project hazelcast by hazelcast.
the class AbstractTargetMessageTask method processInternal.
@Override
protected CompletableFuture<Object> processInternal() {
Operation op = prepareOperation();
op.setCallerUuid(endpoint.getUuid());
MemberImpl member = nodeEngine.getClusterService().getMember(getTargetUuid());
if (member == null) {
throw new TargetNotMemberException(String.format("Member with uuid(%s) is not in member list ", getTargetUuid()));
}
return nodeEngine.getOperationService().createInvocationBuilder(getServiceName(), op, member.getAddress()).setResultDeserialized(false).invoke();
}
Aggregations