runzhiwang edited a comment on pull request #231:
URL: https://github.com/apache/incubator-ratis/pull/231#issuecomment-715370067


   @szetszwo There are some clues,  I print some message as following.
   ```
           JavaUtils.allOf(remoteWrites).thenCombine(localWrite, (v, 
bytesWritten) -> {
                 System.err.println("dataLength:" + request.getDataLength() + " 
bytesWritten:" + bytesWritten);
                 buf.release();
                 sendReply(remoteWrites, request, bytesWritten, ctx);
                 return null;
           });
   ```
   
   ```
       // check writeAsync requests
       for(int i = 0; i < futures.size(); i++) {
         final DataStreamReply reply = futures.get(i).join();
         Assert.assertTrue(reply.isSuccess());
         System.err.println("assert i:" + i + " size:" + 
sizes.get(i).longValue() +
             " written:" + reply.getBytesWritten() + ", dataLen" + 
reply.getDataLength() + ", offset" +
             reply.getStreamOffset() + " stream:" + reply.getStreamId());
       }
   ```
   
   Following is the print result when test fail, we can find written: 791264  
is the next and next message of dataLength: 987326, but the `assert i:7` need 
they are equal, so assert fails.  We can find the reply of assert i:7, i:8, i:9 
 were out of order.
   
   ```
   assert i:5 size:993851 written:993851, dataLen0, offset3911413 stream:1
   assert i:6 size:916080 written:916080, dataLen0, offset4905264 stream:1
   dataLength:987326 bytesWritten:987326
   dataLength:987326 bytesWritten:987326
   dataLength:685952 bytesWritten:685952
   dataLength:685952 bytesWritten:685952
   dataLength:685952 bytesWritten:685952
   dataLength:791264 bytesWritten:791264
   dataLength:791264 bytesWritten:791264
   dataLength:791264 bytesWritten:791264
   assert i:7 size:987326 written:791264, dataLen0, offset7494622 stream:1
   assert i:8 size:685952 written:987326, dataLen0, offset5821344 stream:1
   assert i:9 size:791264 written:685952, dataLen0, offset6808670 stream:1
   ```
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to