peterxcli commented on code in PR #11356:
URL: https://github.com/apache/ozone/pull/11356#discussion_r4192599388


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/LocalStream.java:
##########
@@ -48,6 +56,17 @@ public CompletableFuture<?> cleanUp() {
             executor);
   }
 
+  @Override
+  public CompletableFuture<ByteBuffer> onCommand(ByteBuffer buffer, long 
streamOffset) {
+    return CompletableFuture.supplyAsync(() -> {
+      try {
+        return command.apply(buffer);
+      } catch (IOException e) {

Review Comment:
   we should drain buffer before write with ratis stream 
https://github.com/apache/ozone/blob/2468fa8b14d600ac3d8cc3d748d48f37440acf46/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/KeyValueStreamDataChannel.java#L47
 to prevent data loss.
   ```suggestion
         try {
           // TODO: drain datachannel.buffers
           return command.apply(buffer);
         } catch (IOException e) {
   ```



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