siddhantsangwan commented on code in PR #8492:
URL: https://github.com/apache/ozone/pull/8492#discussion_r2115631996
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/HddsDispatcher.java:
##########
@@ -335,7 +343,15 @@ && getMissingContainerSet().contains(containerID)) {
// Small performance optimization. We check if the operation is of type
// write before trying to send CloseContainerAction.
if (!HddsUtils.isReadOnly(msg)) {
- sendCloseContainerActionIfNeeded(container);
+ boolean isFull = isVolumeFull(container);
+ sendCloseContainerActionIfNeeded(container, isFull);
+ if (isFull) {
+ try {
+ handleFullVolume(container.getContainerData().getVolume());
+ } catch (StorageContainerException e) {
+ ContainerUtils.logAndReturnError(LOG, e, msg);
Review Comment:
To test whether the logging is proper, I added a new test that throws an
exception. Here's what the logs look like:
```
2025-05-30 16:01:08,027 [main] WARN impl.HddsDispatcher
(HddsDispatcher.java:dispatchRequest(354)) - Failed to handle full volume while
handling request: cmdType: WriteChunk
containerID: 1
datanodeUuid: "c6842f19-cbc5-47ca-bce0-f5bc859ef807"
writeChunk {
blockID {
containerID: 1
localID: 1
blockCommitSequenceId: 0
}
chunkData {
chunkName: "36b4d6b58215a7da96e3bf71a602e3ea_stream_1_chunk_1"
offset: 0
len: 36
checksumData {
type: NONE
bytesPerChecksum: 0
}
}
data: "b0bc4858-a308-417d-b363-0631e07b97ec"
}
org.apache.hadoop.hdds.scm.container.common.helpers.StorageContainerException:
Failed to create node report when handling full volume
/var/folders/jp/39hcmgjx4yb_kry3ydxb3c7r0000gn/T/junit-110499014917526916.
Volume Report: { id=DS-db481691-4055-404b-8790-f375e6d41215
dir=/var/folders/jp/39hcmgjx4yb_kry3ydxb3c7r0000gn/T/junit-110499014917526916/hdds
type=DISK capacity=499 used=390 available=109 minFree=100 committed=50 }
at
org.apache.hadoop.ozone.container.common.impl.HddsDispatcher.handleFullVolume(HddsDispatcher.java:481)
at
org.apache.hadoop.ozone.container.common.impl.HddsDispatcher.dispatchRequest(HddsDispatcher.java:352)
at
org.apache.hadoop.ozone.container.common.impl.HddsDispatcher.lambda$dispatch$1(HddsDispatcher.java:199)
at
org.apache.hadoop.hdds.server.OzoneProtocolMessageDispatcher.processRequest(OzoneProtocolMessageDispatcher.java:87)
at
org.apache.hadoop.ozone.container.common.impl.HddsDispatcher.dispatch(HddsDispatcher.java:198)
at
org.apache.hadoop.ozone.container.common.impl.TestHddsDispatcher.testExceptionHandlingWhenVolumeFull(TestHddsDispatcher.java:430)
...
```
--
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]