Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1120,17 +1120,17 @@ public void testMove() throws SCMException, NodeNotFoundException,

//replicate container to dn3
addReplicaToDn(container, dn3, CLOSED);
replicationManager.processContainersNow();
Thread.sleep(100L);
replicationManager.processAll();
eventQueue.processAll(1000);

Assert.assertTrue(datanodeCommandHandler.received(
SCMCommandProto.Type.deleteContainerCommand, dn1.getDatanodeDetails()));
Assert.assertEquals(1, datanodeCommandHandler.getInvocationCount(
SCMCommandProto.Type.deleteContainerCommand));
containerStateManager.removeContainerReplica(id, dn1);

replicationManager.processContainersNow();
Thread.sleep(100L);
replicationManager.processAll();
eventQueue.processAll(1000);

Assert.assertTrue(cf.isDone() && cf.get() == MoveResult.COMPLETED);
}
Expand Down Expand Up @@ -1167,8 +1167,8 @@ public void testMoveNotDeleteSrcIfPolicyNotSatisfied()
//and there are only tree replicas totally, so rm should
//not delete the replica on dn1
containerStateManager.removeContainerReplica(id, dn2);
replicationManager.processContainersNow();
Thread.sleep(100L);
replicationManager.processAll();
eventQueue.processAll(1000);

Assert.assertFalse(datanodeCommandHandler.received(
SCMCommandProto.Type.deleteContainerCommand, dn1.getDatanodeDetails()));
Expand Down Expand Up @@ -1198,21 +1198,21 @@ public void testDnBecameUnhealthyWhenMoving() throws SCMException,
"receive a move request about container"));

nodeManager.setNodeStatus(dn3, new NodeStatus(IN_SERVICE, STALE));
replicationManager.processContainersNow();
Thread.sleep(100L);
replicationManager.processAll();
eventQueue.processAll(1000);

Assert.assertTrue(cf.isDone() && cf.get() ==
MoveResult.REPLICATION_FAIL_NODE_UNHEALTHY);

nodeManager.setNodeStatus(dn3, new NodeStatus(IN_SERVICE, HEALTHY));
cf = replicationManager.move(id, dn1.getDatanodeDetails(), dn3);
addReplicaToDn(container, dn3, CLOSED);
replicationManager.processContainersNow();
Thread.sleep(100L);
replicationManager.processAll();
eventQueue.processAll(1000);
nodeManager.setNodeStatus(dn1.getDatanodeDetails(),
new NodeStatus(IN_SERVICE, STALE));
replicationManager.processContainersNow();
Thread.sleep(100L);
replicationManager.processAll();
eventQueue.processAll(1000);

Assert.assertTrue(cf.isDone() && cf.get() ==
MoveResult.DELETION_FAIL_NODE_UNHEALTHY);
Expand Down Expand Up @@ -1310,9 +1310,9 @@ public void testMovePrerequisites()
new NodeStatus(IN_SERVICE, HEALTHY), State.CLOSED);
ContainerReplica dn6 = addReplica(container,
new NodeStatus(IN_SERVICE, HEALTHY), State.CLOSED);
replicationManager.processContainersNow();
replicationManager.processAll();
//waiting for inflightDeletion generation
Thread.sleep(100L);
eventQueue.processAll(1000);
cf = replicationManager.move(id, dn1.getDatanodeDetails(), dn3);
Assert.assertTrue(cf.isDone() && cf.get() ==
MoveResult.REPLICATION_FAIL_INFLIGHT_DELETION);
Expand All @@ -1324,9 +1324,9 @@ public void testMovePrerequisites()
containerStateManager.removeContainerReplica(id, dn5);
containerStateManager.removeContainerReplica(id, dn4);
//replication manager should generate inflightReplication
replicationManager.processContainersNow();
replicationManager.processAll();
//waiting for inflightReplication generation
Thread.sleep(100L);
eventQueue.processAll(1000);
cf = replicationManager.move(id, dn1.getDatanodeDetails(), dn3);
Assert.assertTrue(cf.isDone() && cf.get() ==
MoveResult.REPLICATION_FAIL_INFLIGHT_REPLICATION);
Expand Down