hangc0276 commented on pull request #3110:
URL: https://github.com/apache/bookkeeper/pull/3110#issuecomment-1067827283


   > close
   
   @lhotari  
   For example
   1. there is a read request for ledger 1, entryId request range is [1, 100].  
When entryId [1, 10] read requests has been sent out and entryId 1 's response 
come back. it will close all the following ReadEntryRequests, and 
`LedgerEntryImpl` object will be recycled. 
   
   2. There is another read request for ledger 2, entryId request range is [1, 
2]. It will get `LedgerEntryImpl` object, which may be the ref is the previous 
one. For example, ReadRequest 2:1 used the same `LedgerEntryImpl` object with 
ReadRequest 1:2. Then send entryId 1 request to the bookkeeper server
   
   3.  Read request 2:1 response came back, and run into `readEntryComplete` 
callback. It will call `entry.complete(rctx.bookieIndex, rctx.to, buffer)` to 
put the buffer into entryImpl's EntryBuf. And then put it into seq list to wait 
for complete
   
   4. Read request 1:2 response came back. It will run into `readEntryComplete` 
callback. It will call `entry.complete(rctx.bookieIndex, rctx.to, buffer)` to 
put the buffer into entryImpl's EntryBuf.  However, the entry has been hold by 
read request 2:1. **This operation will put entry (1:2) bytebuf into entry 
(2:1) bytebuf**.  when run into `submitCallback(BKException.Code.OK);` logic, 
it will be filtered by the complete flag of PendingReadOP.
   
   5. When ledger 2 's read request [1, 2] complete and all the response came 
back, it will return the data to client.
   
   6. However, the entry (2:1) 's data has been tampered by step 4. This is the 
root cause.


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


Reply via email to