-
Notifications
You must be signed in to change notification settings - Fork 621
HDDS-8492. Intermittent timeout in TestStorageContainerManager#testBlockDeletionTransactions. #5928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,6 +35,7 @@ | |||||
| import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.DeletedBlocksTransaction; | ||||||
| import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.IncrementalContainerReportProto; | ||||||
| import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto; | ||||||
| import org.apache.hadoop.hdds.ratis.RatisHelper; | ||||||
| import org.apache.hadoop.hdds.scm.HddsTestUtils; | ||||||
| import org.apache.hadoop.hdds.scm.ScmConfig; | ||||||
| import org.apache.hadoop.hdds.scm.ScmConfigKeys; | ||||||
|
|
@@ -78,6 +79,7 @@ | |||||
| import org.apache.hadoop.ozone.OzoneTestUtils; | ||||||
| import org.apache.hadoop.ozone.container.ContainerTestHelper; | ||||||
| import org.apache.hadoop.ozone.HddsDatanodeService; | ||||||
| import org.apache.hadoop.ozone.container.common.statemachine.DatanodeConfiguration; | ||||||
| import org.apache.hadoop.ozone.container.common.statemachine.DatanodeStateMachine; | ||||||
| import org.apache.hadoop.ozone.container.common.statemachine.EndpointStateMachine; | ||||||
| import org.apache.hadoop.ozone.container.common.states.endpoint.HeartbeatEndpointTask; | ||||||
|
|
@@ -140,6 +142,7 @@ | |||||
| import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_COMMAND_STATUS_REPORT_INTERVAL; | ||||||
| import static org.apache.hadoop.hdds.scm.HddsWhiteboxTestUtils.setInternalState; | ||||||
| import static org.apache.hadoop.hdds.scm.HddsTestUtils.mockRemoteUser; | ||||||
| import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_BLOCK_DELETING_SERVICE_INTERVAL; | ||||||
| import static org.assertj.core.api.Assertions.assertThat; | ||||||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||||||
| import static org.junit.jupiter.api.Assertions.assertFalse; | ||||||
|
|
@@ -273,26 +276,36 @@ private void verifyPermissionDeniedException(Exception e, String userName) { | |||||
| public void testBlockDeletionTransactions() throws Exception { | ||||||
| int numKeys = 5; | ||||||
| OzoneConfiguration conf = new OzoneConfiguration(); | ||||||
| conf.setTimeDuration(HDDS_CONTAINER_REPORT_INTERVAL, 100, | ||||||
| conf.setTimeDuration(OZONE_BLOCK_DELETING_SERVICE_INTERVAL, 100, | ||||||
| TimeUnit.MILLISECONDS); | ||||||
| conf.setTimeDuration(HDDS_COMMAND_STATUS_REPORT_INTERVAL, 100, | ||||||
| DatanodeConfiguration datanodeConfiguration = conf.getObject( | ||||||
| DatanodeConfiguration.class); | ||||||
| datanodeConfiguration.setBlockDeletionInterval(Duration.ofMillis(100)); | ||||||
| conf.setFromObject(datanodeConfiguration); | ||||||
| ScmConfig scmConfig = conf.getObject(ScmConfig.class); | ||||||
| scmConfig.setBlockDeletionInterval(Duration.ofMillis(100)); | ||||||
| conf.setFromObject(scmConfig); | ||||||
|
|
||||||
| conf.setTimeDuration(RatisHelper.HDDS_DATANODE_RATIS_PREFIX_KEY | ||||||
| + ".client.request.write.timeout", 30, TimeUnit.SECONDS); | ||||||
| conf.setTimeDuration(RatisHelper.HDDS_DATANODE_RATIS_PREFIX_KEY | ||||||
| + ".client.request.watch.timeout", 30, TimeUnit.SECONDS); | ||||||
| conf.setInt("hdds.datanode.block.delete.threads.max", 5); | ||||||
| conf.setInt("hdds.datanode.block.delete.queue.limit", 32); | ||||||
| conf.setTimeDuration(HDDS_HEARTBEAT_INTERVAL, 50, | ||||||
| TimeUnit.MILLISECONDS); | ||||||
| conf.setTimeDuration(ScmConfigKeys.OZONE_SCM_HEARTBEAT_PROCESS_INTERVAL, | ||||||
| 3000, | ||||||
| conf.setTimeDuration(HDDS_CONTAINER_REPORT_INTERVAL, 200, | ||||||
| TimeUnit.MILLISECONDS); | ||||||
| conf.setTimeDuration(HDDS_COMMAND_STATUS_REPORT_INTERVAL, 200, | ||||||
| TimeUnit.MILLISECONDS); | ||||||
| conf.setInt(ScmConfigKeys.OZONE_SCM_BLOCK_DELETION_MAX_RETRY, 5); | ||||||
| conf.setTimeDuration(OzoneConfigKeys.OZONE_BLOCK_DELETING_SERVICE_INTERVAL, | ||||||
| 1, TimeUnit.SECONDS); | ||||||
| ScmConfig scmConfig = conf.getObject(ScmConfig.class); | ||||||
| scmConfig.setBlockDeletionInterval(Duration.ofSeconds(1)); | ||||||
| conf.setFromObject(scmConfig); | ||||||
| // Reset container provision size, otherwise only one container | ||||||
| // is created by default. | ||||||
| conf.setInt(ScmConfigKeys.OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT, | ||||||
| numKeys); | ||||||
|
|
||||||
| MiniOzoneCluster cluster = MiniOzoneCluster.newBuilder(conf) | ||||||
| .setHbInterval(100) | ||||||
| .setHbInterval(50) | ||||||
| .build(); | ||||||
| cluster.waitForClusterToBeReady(); | ||||||
|
|
||||||
|
|
@@ -311,7 +324,7 @@ public void testBlockDeletionTransactions() throws Exception { | |||||
| OzoneTestUtils.closeContainers(keyInfo.getKeyLocationVersions(), | ||||||
| cluster.getStorageContainerManager()); | ||||||
| } | ||||||
|
|
||||||
| Thread.sleep(3000); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can use this method to wait for the Container to close but need get the Container list first. ozone/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestHelper.java Lines 326 to 327 in de76edc
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| Map<Long, List<Long>> containerBlocks = createDeleteTXLog( | ||||||
| cluster.getStorageContainerManager(), | ||||||
| delLog, keyLocations, helper); | ||||||
|
|
@@ -334,7 +347,7 @@ public void testBlockDeletionTransactions() throws Exception { | |||||
| } catch (IOException e) { | ||||||
| return false; | ||||||
| } | ||||||
| }, 1000, 10000); | ||||||
| }, 1000, 22000); | ||||||
| assertTrue(helper.verifyBlocksWithTxnTable(containerBlocks)); | ||||||
| // Continue the work, add some TXs that with known container names, | ||||||
| // but unknown block IDs. | ||||||
|
|
@@ -456,7 +469,7 @@ public void testBlockDeletingThrottling() throws Exception { | |||||
| OzoneConfiguration conf = new OzoneConfiguration(); | ||||||
| conf.setTimeDuration(HDDS_CONTAINER_REPORT_INTERVAL, 1, TimeUnit.SECONDS); | ||||||
| conf.setInt(ScmConfigKeys.OZONE_SCM_BLOCK_DELETION_MAX_RETRY, 5); | ||||||
| conf.setTimeDuration(OzoneConfigKeys.OZONE_BLOCK_DELETING_SERVICE_INTERVAL, | ||||||
| conf.setTimeDuration(OZONE_BLOCK_DELETING_SERVICE_INTERVAL, | ||||||
| 100, TimeUnit.MILLISECONDS); | ||||||
| ScmConfig scmConfig = conf.getObject(ScmConfig.class); | ||||||
| scmConfig.setBlockDeletionInterval(Duration.ofMillis(100)); | ||||||
|
|
@@ -839,7 +852,7 @@ public void testCloseContainerCommandOnRestart() throws Exception { | |||||
| OzoneConfiguration conf = new OzoneConfiguration(); | ||||||
| conf.setTimeDuration(HDDS_CONTAINER_REPORT_INTERVAL, 1, TimeUnit.SECONDS); | ||||||
| conf.setInt(ScmConfigKeys.OZONE_SCM_BLOCK_DELETION_MAX_RETRY, 5); | ||||||
| conf.setTimeDuration(OzoneConfigKeys.OZONE_BLOCK_DELETING_SERVICE_INTERVAL, | ||||||
| conf.setTimeDuration(OZONE_BLOCK_DELETING_SERVICE_INTERVAL, | ||||||
| 100, TimeUnit.MILLISECONDS); | ||||||
| conf.setInt(ScmConfigKeys.OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT, | ||||||
| numKeys); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that the other tests have similar logic (such as:
testBlockDeletingThrottling, it closeContainertoo). Is it possible to have the same bugs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this test also passes in repeated runs, I would not want to change anything in this test as of now. Kindly re-review.