jojochuang commented on code in PR #6014:
URL: https://github.com/apache/ozone/pull/6014#discussion_r1628387017
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java:
##########
@@ -511,22 +514,33 @@ ContainerCommandResponseProto> executePutBlock(boolean
close,
putBlockAsync(xceiverClient, blockData, close, tokenString);
CompletableFuture<ContainerProtos.ContainerCommandResponseProto> future =
asyncReply.getResponse();
+
flushFuture = future.thenApplyAsync(e -> {
try {
validateResponse(e);
} catch (IOException sce) {
throw new CompletionException(sce);
}
+ boolean timedOut = e.getMessage().equals("TIMEOUT");
Review Comment:
hacky. Is there a better way to detect timeout?
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java:
##########
@@ -808,22 +823,33 @@ CompletableFuture<ContainerCommandResponseProto>
writeChunkToContainer(
blockID.get(), data, tokenString, replicationIndex, blockData);
CompletableFuture<ContainerProtos.ContainerCommandResponseProto>
respFuture = asyncReply.getResponse();
+
validateFuture = respFuture.thenApplyAsync(e -> {
try {
validateResponse(e);
} catch (IOException sce) {
respFuture.completeExceptionally(sce);
}
+ boolean timedOut = e.getMessage().equals("TIMEOUT");
// if the ioException is not set, putBlock is successful
- if (getIoException() == null && putBlockPiggybacking) {
+ if (getIoException() == null && putBlockPiggybacking) { // & !timedOut
handleSuccessfulPutBlock(e.getWriteChunk().getCommittedBlockLength(),
asyncReply, flushPos, byteBufferList);
}
+ if (timedOut) {
Review Comment:
extract this area of code so executePutBlock can reuse.
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java:
##########
@@ -291,7 +292,10 @@ public static XceiverClientReply
putBlockAsync(XceiverClientSpi xceiverClient,
throws IOException, InterruptedException, ExecutionException {
final ContainerCommandRequestProto request = getPutBlockRequest(
xceiverClient.getPipeline(), containerBlockData, eof, tokenString);
- return xceiverClient.sendCommandAsync(request);
+ // TODO: Make only putBlock triggered from hsync ALL_COMMITTED.
+ // While keeping the ones triggered from write() and others at MAJORITY
+ // and call regular watchForCommit in order to reduce latency for
write()s.
Review Comment:
consider the case where PutBlock is piggybacked in a WriteChunk too.
--
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]