shuwenwei opened a new pull request, #17709:
URL: https://github.com/apache/iotdb/pull/17709

   ### What changed
   - Avoid reusing an unsorted mutable working TVList for flushing-memtable 
queries when another query may still be reading the original list.
   - Use the working list for flush when the flushing query cannot safely reuse 
the original TVList.
   - Keep the original list bound to the query context because the flush 
working list can share value arrays with it.
   - Add regression coverage for the Q1/Q2/FLUSH ordering that could previously 
reorder indices behind Q1's stale row-count view.
   
   ### Why
   Q1 may query the working memtable and record a smaller visible row count. 
Later out-of-order writes append to the same TVList, then FLUSH moves the 
memtable to flushing. If Q2 queries the flushing memtable and sorts the 
original mutable TVList in place, Q1 may continue reading with old rows but 
reordered indices, causing bitmap index out-of-bound.
   
   ### Validation
   - Added 
`PrimitiveMemTableTest#testFlushingQueryDoesNotSortWorkingTVListUsedByPreviousQuery`


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