From abace709cc0acf25ecd87fba3da5c99e627101b4 Mon Sep 17 00:00:00 2001 From: Arpit Agarwal Date: Fri, 12 Apr 2019 12:21:10 +0200 Subject: [PATCH] HDDS-1420. Tracing exception in DataNode HddsDispatcher Closes #723 --- .../commandhandler/CloseContainerCommandHandler.java | 2 -- .../container/common/impl/TestHddsDispatcher.java | 1 - .../TestCloseContainerCommandHandler.java | 1 - .../rpc/TestContainerStateMachineFailures.java | 2 -- .../hadoop/ozone/container/ContainerTestHelper.java | 12 ------------ 5 files changed, 18 deletions(-) diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java index ac9d24e844..d4c3ff722a 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java @@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory; import java.io.IOException; -import java.util.UUID; /** * Handler for close container command received from SCM. @@ -138,7 +137,6 @@ private ContainerCommandRequestProto getContainerCommandRequestProto( command.setContainerID(containerId); command.setCloseContainer( ContainerProtos.CloseContainerRequestProto.getDefaultInstance()); - command.setTraceID(UUID.randomUUID().toString()); command.setDatanodeUuid(datanodeDetails.getUuidString()); return command.build(); } diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestHddsDispatcher.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestHddsDispatcher.java index 6e37b4c0b9..d425820193 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestHddsDispatcher.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestHddsDispatcher.java @@ -266,7 +266,6 @@ private ContainerCommandRequestProto getWriteChunkRequest( .newBuilder() .setContainerID(containerId) .setCmdType(ContainerProtos.Type.WriteChunk) - .setTraceID(UUID.randomUUID().toString()) .setDatanodeUuid(datanodeId) .setWriteChunk(writeChunkRequest) .build(); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerCommandHandler.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerCommandHandler.java index 731e74c19c..7962cb2f3b 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerCommandHandler.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerCommandHandler.java @@ -305,7 +305,6 @@ private Container createContainer(final Configuration conf, request.setContainerID(containerId.getId()); request.setCreateContainer( ContainerProtos.CreateContainerRequestProto.getDefaultInstance()); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(datanodeDetails.getUuidString()); ozoneContainer.getWriteChannel().submitRequest( request.build(), pipelineID.getProtobuf()); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailures.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailures.java index a8b72954b6..5739d48c65 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailures.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailures.java @@ -43,7 +43,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; -import java.util.UUID; import java.util.concurrent.TimeUnit; import static org.apache.hadoop.hdds.HddsConfigKeys. @@ -181,7 +180,6 @@ public void testContainerStateMachineFailures() throws Exception { request.setContainerID(containerID); request.setCreateContainer( ContainerProtos.CreateContainerRequestProto.getDefaultInstance()); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid( cluster.getHddsDatanodes().get(0).getDatanodeDetails().getUuidString()); Assert.assertEquals(ContainerProtos.Result.CONTAINER_MISSING, diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ContainerTestHelper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ContainerTestHelper.java index dc5e8b43bb..93807b4c2c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ContainerTestHelper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ContainerTestHelper.java @@ -239,7 +239,6 @@ public static ContainerCommandRequestProto getWriteChunkRequest( request.setCmdType(ContainerProtos.Type.WriteChunk); request.setContainerID(blockID.getContainerID()); request.setWriteChunk(writeRequest); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return request.build(); @@ -281,7 +280,6 @@ public static ContainerCommandRequestProto getWriteSmallFileRequest( request.setCmdType(ContainerProtos.Type.PutSmallFile); request.setContainerID(blockID.getContainerID()); request.setPutSmallFile(smallFileRequest); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return request.build(); } @@ -300,7 +298,6 @@ public static ContainerCommandRequestProto getReadSmallFileRequest( request.setCmdType(ContainerProtos.Type.GetSmallFile); request.setContainerID(getKey.getGetBlock().getBlockID().getContainerID()); request.setGetSmallFile(smallFileRequest); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return request.build(); } @@ -330,7 +327,6 @@ public static ContainerCommandRequestProto getReadChunkRequest( newRequest.setCmdType(ContainerProtos.Type.ReadChunk); newRequest.setContainerID(readRequest.getBlockID().getContainerID()); newRequest.setReadChunk(readRequest); - newRequest.setTraceID(UUID.randomUUID().toString()); newRequest.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return newRequest.build(); } @@ -363,7 +359,6 @@ public static ContainerCommandRequestProto getDeleteChunkRequest( request.setCmdType(ContainerProtos.Type.DeleteChunk); request.setContainerID(writeRequest.getBlockID().getContainerID()); request.setDeleteChunk(deleteRequest); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return request.build(); } @@ -402,7 +397,6 @@ private static Builder getContainerCommandRequestBuilder(long containerID, request.setContainerID(containerID); request.setCreateContainer( ContainerProtos.CreateContainerRequestProto.getDefaultInstance()); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return request; @@ -455,7 +449,6 @@ public static ContainerCommandRequestProto getUpdateContainerRequest( request.setCmdType(ContainerProtos.Type.UpdateContainer); request.setContainerID(containerID); request.setUpdateContainer(updateRequestBuilder.build()); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return request.build(); } @@ -506,7 +499,6 @@ public static ContainerCommandRequestProto getPutBlockRequest( request.setCmdType(ContainerProtos.Type.PutBlock); request.setContainerID(blockData.getContainerID()); request.setPutBlock(putRequest); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return request.build(); } @@ -534,7 +526,6 @@ public static ContainerCommandRequestProto getBlockRequest( request.setCmdType(ContainerProtos.Type.GetBlock); request.setContainerID(blockID.getContainerID()); request.setGetBlock(getRequest); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return request.build(); } @@ -571,7 +562,6 @@ public static ContainerCommandRequestProto getDeleteBlockRequest( request.setCmdType(ContainerProtos.Type.DeleteBlock); request.setContainerID(blockID.getContainerID()); request.setDeleteBlock(delRequest); - request.setTraceID(UUID.randomUUID().toString()); request.setDatanodeUuid(pipeline.getFirstNode().getUuidString()); return request.build(); } @@ -590,7 +580,6 @@ public static ContainerCommandRequestProto getCloseContainer( .setContainerID(containerID) .setCloseContainer( ContainerProtos.CloseContainerRequestProto.getDefaultInstance()) - .setTraceID(UUID.randomUUID().toString()) .setDatanodeUuid(pipeline.getFirstNode().getUuidString()) .build(); @@ -635,7 +624,6 @@ public static ContainerCommandRequestProto getDeleteContainer( .setDeleteContainer( ContainerProtos.DeleteContainerRequestProto.getDefaultInstance()) .setDeleteContainer(deleteRequest) - .setTraceID(UUID.randomUUID().toString()) .setDatanodeUuid(pipeline.getFirstNode().getUuidString()) .build(); }