devmadhuu commented on code in PR #11988:
URL: https://github.com/apache/ozone/pull/11988#discussion_r4582713342
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandler.java:
##########
@@ -1331,6 +1339,72 @@ private static OzoneContainer
mockOzoneContainerWithSCDomainSocket() {
return ozoneContainer;
}
+ private static Stream<Arguments> blockResponseStorageTypes() {
+ return Stream.of(null, StorageType.DISK, StorageType.SSD,
StorageType.ARCHIVE)
+ .flatMap(recordedType -> Stream.of(null, StorageType.DISK,
StorageType.SSD, StorageType.ARCHIVE)
+ .map(storedType -> Arguments.of(recordedType, storedType)));
+ }
+
+ @ParameterizedTest
+ @MethodSource("blockResponseStorageTypes")
+ public void testBlockResponsesUseContainerStorageType(StorageType
recordedType, StorageType storedType)
Review Comment:
Thanks @amaliujia for raising this point. I agree that this can create
confusion. But, using the container replica’s recorded StorageType is
intentional. This response field represents the recorded container type, rather
than its current volume label.
For example, after a volume is relabelled from `SSD` to `DISK`, the
container may still record `SSD`. The response continues to return SSD,
consistent with the metadata used for write validation. Container reports
separately expose `volumeStorageType = DISK` so SCM can detect the mismatch.
Similarly, for legacy containers whose recorded type is null, the optional
response field remains absent rather than being inferred from the volume. The
test deliberately covers these cases. This follows the recorded-type versus
volume-type distinction discussed in #11926.
--
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]