nativeCat opened a new issue, #554:
URL: https://github.com/apache/doris-flink-connector/issues/554

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Version
   
   master
   release-24.1.0
   
   ### What's Wrong?
   
   When the flush thread pushes a buffer to the `flushQueue` but has not yet 
removed it from the `bufferMap`, the processing thread may retrieve the buffer 
that has already been pushed to the `flushQueue`. This results in the buffer 
not being in a read-only state. 
   If, at this point, the import thread executes `drainTo` to retrieve the 
non-read-only buffer and performs a merge operation, a thread-safety issue may 
arise because of the buffer is `LinkedList`. 
   This could lead to an` ArrayIndexOutOfBoundsException` or result in data 
loss.
   
   
![Image](https://github.com/user-attachments/assets/d6217315-dfe0-4e40-b0bd-6f18a6d77e4f)
   
   ### What You Expected?
   
   Let`putRecordToFlushQueue(buffer); bufferMap.remove(bufferKey)` is a 
transactional operation
   
   ### How to Reproduce?
   
   When the flush thread pushes a buffer to the `flushQueue` but has not yet 
removed it from the `bufferMap`, the processing thread may retrieve the buffer 
that has already been pushed to the `flushQueue`. This results in the buffer 
not being in a read-only state. 
   If, at this point, the import thread executes `drainTo` to retrieve the 
non-read-only buffer and performs a merge operation, a thread-safety issue may 
arise because of the buffer is `LinkedList`. 
   This could lead to an` ArrayIndexOutOfBoundsException` or result in data 
loss.
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to