greenwich commented on code in PR #11223:
URL: https://github.com/apache/ozone/pull/11223#discussion_r4002483690
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java:
##########
@@ -195,6 +196,8 @@ public BlockOutputStream(
if (replicationIndex > 0) {
blkIDBuilder.setReplicaIndex(replicationIndex);
}
+ // TODO: Replica to the method parameter
+ blkIDBuilder.setStorageTypeID(StorageTypeUtils.getID(StorageType.DISK));
Review Comment:
Could this stay unset? `HDDS-15882` will set the real type at the
`writeChunkAsync` call below, which wouldn't touch this builder — so this line
would be easy to leave behind claiming `DISK`.
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestHddsDispatcher.java:
##########
@@ -532,15 +533,20 @@ public void
testCreateContainerWithPutSmallFileWithStorageType() throws IOExcept
}
@Test
- public void testCreateContainerRejectsInvalidStorageType() throws
IOException {
+ public void testInvalidStorageTypeDoesNotMarkContainerUnhealthy() throws
IOException {
Review Comment:
With a valid write now preceding it, this exercises the new dispatch-level
guard rather than the create-path check in `handleCreateContainer`. Could the
original be kept as a separate test so both paths stay covered?
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java:
##########
@@ -187,6 +188,15 @@ public long persistPutBlock(KeyValueContainer container,
Objects.requireNonNull(data, "data == null");
Preconditions.checkState(data.getContainerID() >= 0, "Container Id " +
"cannot be negative");
+ if (data.getBlockID().getStorageType() != null
Review Comment:
worth extracting a small helper? `PutBlock` and `PutSmallFile` also run it
twice, since `persistPutBlock` repeats it underneath
--
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]