[ 
https://issues.apache.org/jira/browse/HDDS-2523?focusedWorklogId=346300&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-346300
 ]

ASF GitHub Bot logged work on HDDS-2523:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Nov/19 22:10
            Start Date: 19/Nov/19 22:10
    Worklog Time Spent: 10m 
      Work Description: adoroszlai commented on pull request #232: HDDS-2523. 
BufferPool.releaseBuffer may release a buffer different than the head of the 
list
URL: https://github.com/apache/hadoop-ozone/pull/232
 
 
   ## What changes were proposed in this pull request?
   
   For standalone replication type log index is always 0.  Each PutBlock's list 
of buffers are written to the same entry in the `commitIndex2flushedDataMap` 
map.  Thus only the last PutBlock's buffers are released during flush.
   
   The problem was exposed during review of #205, where 
`IncrementalChunkBuffer` did not implement `equals()`, ie. it was the same as 
`==`.  This caused the precondition in `BufferPool.releaseBuffer` to fail for 
`TestContainerMapper` (which uses standalone replication).
   
   https://issues.apache.org/jira/browse/HDDS-2523
   
   ## How was this patch tested?
   
   `TestContainerMapper` passes with the fix, but fails with only the 
precondition change.
   
   Clean CI in private branch: 
https://github.com/adoroszlai/hadoop-ozone/runs/310502460
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 346300)
    Remaining Estimate: 0h
            Time Spent: 10m

> BufferPool.releaseBuffer may release a buffer different than the head of the 
> list
> ---------------------------------------------------------------------------------
>
>                 Key: HDDS-2523
>                 URL: https://issues.apache.org/jira/browse/HDDS-2523
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: Ozone Client
>            Reporter: Tsz-wo Sze
>            Assignee: Attila Doroszlai
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: a.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {code}
> //BufferPool
>   public void releaseBuffer(ByteBuffer byteBuffer) {
>     // always remove from head of the list and append at last
>     ByteBuffer buffer = bufferList.remove(0);
>     // Ensure the buffer to be removed is always at the head of the list.
>     Preconditions.checkArgument(buffer.equals(byteBuffer));
>     buffer.clear();
>     bufferList.add(buffer);
>     Preconditions.checkArgument(currentBufferIndex >= 0);
>     currentBufferIndex--;
>   }
> {code}
> In the code above, it expects buffer and byteBuffer are the same object, i.e. 
>  buffer == byteBuffer.  However the precondition is checking 
> buffer.equals(byteBuffer). Unfortunately, both buffer and byteBuffer have 
> remaining() == 0 so that equals(..) returns true and the precondition does 
> not catch the bug.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to