|
30 | 30 | import org.apache.hadoop.hdds.scm.container.ContainerInfo;
|
31 | 31 | import org.apache.hadoop.hdds.scm.container.ContainerNotFoundException;
|
32 | 32 | import org.apache.hadoop.hdds.scm.container.ContainerReplica;
|
33 |
| -import org.apache.hadoop.hdds.scm.container.replication.LegacyRatisContainerReplicaCount; |
34 | 33 | import org.apache.hadoop.hdds.scm.container.replication.RatisContainerReplicaCount;
|
35 | 34 | import org.apache.hadoop.hdds.scm.container.replication.ReplicationManager;
|
36 | 35 | import org.apache.hadoop.hdds.scm.container.SimpleMockNodeManager;
|
@@ -223,85 +222,6 @@ public void testDecommissionNodeWaitsForContainersToReplicate()
|
223 | 222 | nodeManager.getNodeStatus(dn1).getOperationalState());
|
224 | 223 | }
|
225 | 224 |
|
226 |
| - /** |
227 |
| - * Situation: A QUASI_CLOSED container has an UNHEALTHY replica with the |
228 |
| - * greatest BCSID, and three QUASI_CLOSED replicas with a smaller BCSID. The |
229 |
| - * UNHEALTHY container is on a decommissioning node, and there are no other |
230 |
| - * copies of this replica, that is, replicas with the same Origin ID as |
231 |
| - * this replica. |
232 |
| - * |
233 |
| - * Expectation: Decommissioning should not complete until the UNHEALTHY |
234 |
| - * replica has been replicated to another node. |
235 |
| - * |
236 |
| - * Note: This test currently uses the LegacyReplicationManager, as the new |
237 |
| - * one doesn't support this behaviour yet. |
238 |
| - * @throws NodeNotFoundException |
239 |
| - * @throws ContainerNotFoundException |
240 |
| - */ |
241 |
| - @Test |
242 |
| - public void testDecommissionWaitsForUnhealthyReplicaToReplicate() |
243 |
| - throws NodeNotFoundException, ContainerNotFoundException { |
244 |
| - conf.setBoolean("hdds.scm.replication.enable.legacy", true); |
245 |
| - |
246 |
| - DatanodeDetails dn1 = MockDatanodeDetails.randomDatanodeDetails(); |
247 |
| - nodeManager.register(dn1, |
248 |
| - new NodeStatus(HddsProtos.NodeOperationalState.DECOMMISSIONING, |
249 |
| - HddsProtos.NodeState.HEALTHY)); |
250 |
| - |
251 |
| - // create 3 QUASI_CLOSED replicas with containerID 1 and same origin ID |
252 |
| - ContainerID containerID = ContainerID.valueOf(1); |
253 |
| - Set<ContainerReplica> replicas = |
254 |
| - ReplicationTestUtil.createReplicasWithSameOrigin(containerID, |
255 |
| - State.QUASI_CLOSED, 0, 0, 0); |
256 |
| - |
257 |
| - // the container's sequence id is greater than the healthy replicas' |
258 |
| - ContainerInfo container = ReplicationTestUtil.createContainerInfo( |
259 |
| - RatisReplicationConfig.getInstance( |
260 |
| - HddsProtos.ReplicationFactor.THREE), containerID.getId(), |
261 |
| - HddsProtos.LifeCycleState.QUASI_CLOSED, |
262 |
| - replicas.iterator().next().getSequenceId() + 1); |
263 |
| - // UNHEALTHY replica is on a unique origin and has same sequence id as |
264 |
| - // the container |
265 |
| - ContainerReplica unhealthy = |
266 |
| - ReplicationTestUtil.createContainerReplica(containerID, 0, |
267 |
| - dn1.getPersistedOpState(), State.UNHEALTHY, |
268 |
| - container.getNumberOfKeys(), container.getUsedBytes(), dn1, |
269 |
| - dn1.getUuid(), container.getSequenceId()); |
270 |
| - replicas.add(unhealthy); |
271 |
| - nodeManager.setContainers(dn1, ImmutableSet.of(containerID)); |
272 |
| - |
273 |
| - when(repManager.getContainerReplicaCount(eq(containerID))) |
274 |
| - .thenReturn(new LegacyRatisContainerReplicaCount(container, replicas, |
275 |
| - 0, 0, 3, 2)); |
276 |
| - |
277 |
| - // start monitoring dn1 |
278 |
| - monitor.startMonitoring(dn1); |
279 |
| - monitor.run(); |
280 |
| - assertEquals(1, monitor.getTrackedNodeCount()); |
281 |
| - assertEquals(HddsProtos.NodeOperationalState.DECOMMISSIONING, |
282 |
| - nodeManager.getNodeStatus(dn1).getOperationalState()); |
283 |
| - |
284 |
| - // Running the monitor again causes it to remain DECOMMISSIONING |
285 |
| - // as nothing has changed. |
286 |
| - monitor.run(); |
287 |
| - assertEquals(HddsProtos.NodeOperationalState.DECOMMISSIONING, |
288 |
| - nodeManager.getNodeStatus(dn1).getOperationalState()); |
289 |
| - |
290 |
| - // add a copy of the UNHEALTHY replica on a new node, dn1 should get |
291 |
| - // decommissioned now |
292 |
| - ContainerReplica copyOfUnhealthyOnNewNode = unhealthy.toBuilder() |
293 |
| - .setDatanodeDetails(MockDatanodeDetails.randomDatanodeDetails()) |
294 |
| - .build(); |
295 |
| - replicas.add(copyOfUnhealthyOnNewNode); |
296 |
| - when(repManager.getContainerReplicaCount(eq(containerID))) |
297 |
| - .thenReturn(new LegacyRatisContainerReplicaCount(container, replicas, |
298 |
| - 0, 0, 3, 2)); |
299 |
| - monitor.run(); |
300 |
| - assertEquals(0, monitor.getTrackedNodeCount()); |
301 |
| - assertEquals(HddsProtos.NodeOperationalState.DECOMMISSIONED, |
302 |
| - nodeManager.getNodeStatus(dn1).getOperationalState()); |
303 |
| - } |
304 |
| - |
305 | 225 | /**
|
306 | 226 | * Situation: A QUASI_CLOSED container has an UNHEALTHY replica with the
|
307 | 227 | * greatest BCSID, and three QUASI_CLOSED replicas with a smaller BCSID. The
|
@@ -440,72 +360,6 @@ public void testDecommissionWaitsForUnhealthyReplicaWithUniqueOriginToReplicateN
|
440 | 360 | nodeManager.getNodeStatus(dn1).getOperationalState());
|
441 | 361 | }
|
442 | 362 |
|
443 |
| - /** |
444 |
| - * Consider a QUASI_CLOSED container with only UNHEALTHY replicas. If one |
445 |
| - * of its nodes is decommissioned, the decommissioning should succeed. |
446 |
| - */ |
447 |
| - @Test |
448 |
| - public void testQuasiClosedContainerWithAllUnhealthyReplicas() |
449 |
| - throws NodeNotFoundException, ContainerNotFoundException { |
450 |
| - conf.setBoolean("hdds.scm.replication.enable.legacy", true); |
451 |
| - |
452 |
| - DatanodeDetails decommissioningNode = |
453 |
| - MockDatanodeDetails.randomDatanodeDetails(); |
454 |
| - nodeManager.register(decommissioningNode, |
455 |
| - new NodeStatus(HddsProtos.NodeOperationalState.DECOMMISSIONING, |
456 |
| - HddsProtos.NodeState.HEALTHY)); |
457 |
| - ContainerInfo container = ReplicationTestUtil.createContainer( |
458 |
| - HddsProtos.LifeCycleState.QUASI_CLOSED, |
459 |
| - RatisReplicationConfig.getInstance( |
460 |
| - HddsProtos.ReplicationFactor.THREE)); |
461 |
| - Set<ContainerReplica> replicas = |
462 |
| - ReplicationTestUtil.createReplicas(container.containerID(), |
463 |
| - State.UNHEALTHY, 0, 0); |
464 |
| - |
465 |
| - ContainerReplica decommissioningReplica = |
466 |
| - ReplicationTestUtil.createContainerReplica(container.containerID(), 0, |
467 |
| - DECOMMISSIONING, State.UNHEALTHY, container.getNumberOfKeys(), |
468 |
| - container.getUsedBytes(), decommissioningNode, |
469 |
| - decommissioningNode.getUuid()); |
470 |
| - replicas.add(decommissioningReplica); |
471 |
| - nodeManager.setContainers(decommissioningNode, |
472 |
| - ImmutableSet.of(container.containerID())); |
473 |
| - |
474 |
| - when(repManager.getContainerReplicaCount( |
475 |
| - eq(container.containerID()))) |
476 |
| - .thenReturn(new LegacyRatisContainerReplicaCount(container, replicas, |
477 |
| - Collections.emptyList(), 2, true)); |
478 |
| - |
479 |
| - // start monitoring dn1 |
480 |
| - monitor.startMonitoring(decommissioningNode); |
481 |
| - monitor.run(); |
482 |
| - assertEquals(1, monitor.getTrackedNodeCount()); |
483 |
| - assertEquals(HddsProtos.NodeOperationalState.DECOMMISSIONING, |
484 |
| - nodeManager.getNodeStatus(decommissioningNode).getOperationalState()); |
485 |
| - |
486 |
| - // Running the monitor again causes it to remain DECOMMISSIONING |
487 |
| - // as nothing has changed. |
488 |
| - monitor.run(); |
489 |
| - assertEquals(HddsProtos.NodeOperationalState.DECOMMISSIONING, |
490 |
| - nodeManager.getNodeStatus(decommissioningNode).getOperationalState()); |
491 |
| - |
492 |
| - // add a copy of the UNHEALTHY replica on a new node, decommissioningNode |
493 |
| - // should get decommissioned now |
494 |
| - ContainerReplica copyOfUnhealthyOnNewNode = |
495 |
| - decommissioningReplica.toBuilder() |
496 |
| - .setDatanodeDetails(MockDatanodeDetails.randomDatanodeDetails()) |
497 |
| - .build(); |
498 |
| - replicas.add(copyOfUnhealthyOnNewNode); |
499 |
| - when(repManager.getContainerReplicaCount( |
500 |
| - eq(container.containerID()))) |
501 |
| - .thenReturn(new LegacyRatisContainerReplicaCount(container, replicas, |
502 |
| - Collections.emptyList(), 3, true)); |
503 |
| - monitor.run(); |
504 |
| - assertEquals(0, monitor.getTrackedNodeCount()); |
505 |
| - assertEquals(HddsProtos.NodeOperationalState.DECOMMISSIONED, |
506 |
| - nodeManager.getNodeStatus(decommissioningNode).getOperationalState()); |
507 |
| - } |
508 |
| - |
509 | 363 | @Test
|
510 | 364 | public void testDecommissionNotBlockedByDeletingContainers()
|
511 | 365 | throws NodeNotFoundException, ContainerNotFoundException {
|
@@ -840,7 +694,6 @@ public void testCancelledNodesMovedToInService()
|
840 | 694 | @Test
|
841 | 695 | public void testContainersReplicatedOnDecomDnAPI()
|
842 | 696 | throws NodeNotFoundException, ContainerNotFoundException {
|
843 |
| - conf.setBoolean("hdds.scm.replication.enable.legacy", false); |
844 | 697 |
|
845 | 698 | DatanodeDetails dn1 = MockDatanodeDetails.randomDatanodeDetails();
|
846 | 699 | nodeManager.register(dn1,
|
|
0 commit comments