aswinshakil commented on code in PR #3518:
URL: https://github.com/apache/ozone/pull/3518#discussion_r899641076


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMBlockProtocolServer.java:
##########
@@ -196,6 +196,16 @@ public List<AllocatedBlock> allocateBlock(
           blocks.add(block);

Review Comment:
   I have quick question. Here when `scm.getScmBlockManager().allocateBlock()` 
fails to allocate a block why don't we throw an exception where it is failing? 
One example is this patch HDDS-6812, I'm trying to throw an exception here,  
   
https://github.com/apache/ozone/blob/3768bc6f0c3fc56423dd86815027fc583d0c6260/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java#L160
 
   If my change comes in, I believe it gives the user better Exception of why 
allocateBlock failed (Here it failed because it didn't have enough DN for EC) 
instead of saying something like `Allocated 0 blocks. Requested 1 blocks`. 
Either way when the allocated block count is lower than requested block we 
throw an `SCMException`
   
https://github.com/apache/ozone/blob/3768bc6f0c3fc56423dd86815027fc583d0c6260/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/ScmBlockLocationProtocolServerSideTranslatorPB.java#L204-L207
   Is there a particular reason why we still try `allocateBlock()`, when one 
block allocation fails?



-- 
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]

Reply via email to