umamaheswararao commented on a change in pull request #2929:
URL: https://github.com/apache/ozone/pull/2929#discussion_r773393397



##########
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java
##########
@@ -259,7 +259,7 @@ private StripeWriteStatus rewriteStripeToNewBlockGroup(int 
chunkSize,
         blockOutputStreamEntryPool.getCurrentStreamEntry();
     newBlockGroupStreamEntry
         .updateBlockGroupToAckedPosition(failedStripeDataSize);
-    ecChunkBufferCache.clear(chunkSize);

Review comment:
       I believe something like this should fix that existing issue of buffer 
overriding on allocateBuffers in writeParityCells:
   ```
   --- 
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java
   +++ 
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java
   @@ -319,8 +319,10 @@ private void 
addToExcludeNodesList(List<ECBlockOutputStream> failedStreams) {
    
      void writeParityCells(int parityCellSize) throws IOException {
        final ByteBuffer[] buffers = ecChunkBufferCache.getDataBuffers();
   -    ecChunkBufferCache.allocateParityBuffers(parityCellSize);
        final ByteBuffer[] parityBuffers = 
ecChunkBufferCache.getParityBuffers();
   +    for (int i=0;i<parityBuffers.length;i++){
   +      parityBuffers[i].limit(parityCellSize);
   +    }
    
        for(int i=0; i< buffers.length; i++){
          buffers[i].flip();
   @@ -639,6 +641,7 @@ private void checkNotClosed() throws IOException {
          dataBuffers = new ByteBuffer[numData];
          parityBuffers = new ByteBuffer[numParity];
          allocateBuffers(cellSize, dataBuffers);
   +      allocateBuffers(cellSize, parityBuffers);
        }
    
        private ByteBuffer[] getDataBuffers() {
   @@ -649,10 +652,6 @@ private void checkNotClosed() throws IOException {
          return parityBuffers;
        }
    
   -    public void allocateParityBuffers(int size){
   -      allocateBuffers(size, parityBuffers);
   -    }
   -
   ```
   




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