Skip to content

[to dev/1.3] Fix query reuse of flushing memtable TVList#17709

Open
shuwenwei wants to merge 1 commit into
dev/1.3from
fixBug0518-1.3
Open

[to dev/1.3] Fix query reuse of flushing memtable TVList#17709
shuwenwei wants to merge 1 commit into
dev/1.3from
fixBug0518-1.3

Conversation

@shuwenwei
Copy link
Copy Markdown
Member

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

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.10%. Comparing base (fea9a2f) to head (b30181c).

Additional details and impacted files
@@              Coverage Diff              @@
##             dev/1.3   #17709      +/-   ##
=============================================
- Coverage      42.10%   42.10%   -0.01%     
  Complexity       241      241              
=============================================
  Files           3613     3613              
  Lines         238738   238749      +11     
  Branches       29001    29003       +2     
=============================================
- Hits          100525   100519       -6     
- Misses        138213   138230      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant