neils-dev commented on code in PR #3741:
URL: https://github.com/apache/ozone/pull/3741#discussion_r1122557212
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/TestHddsDatanodeService.java:
##########
@@ -88,6 +125,44 @@ public void testStartup() throws IOException {
service.close();
}
+ @ParameterizedTest
+ @ValueSource(strings = {OzoneConsts.SCHEMA_V1,
+ OzoneConsts.SCHEMA_V2, OzoneConsts.SCHEMA_V3})
+ public void testTmpDirOnShutdown(String schemaVersion) throws IOException {
+ ContainerTestVersionInfo.setTestSchemaVersion(schemaVersion, conf);
+ LOG.info("SchemaV3_enabled: " +
+ conf.get(DatanodeConfiguration.CONTAINER_SCHEMA_V3_ENABLED));
+ service.start(conf);
+
+ // Get volumeSet and store volumes in temp folders
+ // in order to access them after service.stop()
+ MutableVolumeSet volumeSet = service
+ .getDatanodeStateMachine().getContainer().getVolumeSet();
+ List<HddsVolume> volumes = StorageVolumeUtil.getHddsVolumesList(
+ volumeSet.getVolumesList());
+
+ for (HddsVolume volume : volumes) {
+ StorageVolumeUtil.checkVolume(volume, clusterId,
+ clusterId, conf, LOG, null);
+ // Create a container and move it under the tmp delete dir.
+ KeyValueContainer container = ContainerTestUtils
+ .setUpTestContainer(volume, clusterId, conf, schemaVersion);
+ assertTrue(container.getContainerFile().exists());
Review Comment:
For Schema_V3, an added entry into the db and deleting entry based on
container in tmp directory would be a great addition.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]