Skip to content

Fix query TVList snapshot race during working memtable reads#17699

Closed
shuwenwei wants to merge 1 commit into
masterfrom
fixConcurrentIssues-0518
Closed

Fix query TVList snapshot race during working memtable reads#17699
shuwenwei wants to merge 1 commit into
masterfrom
fixConcurrentIssues-0518

Conversation

@shuwenwei
Copy link
Copy Markdown
Member

Summary

  • Capture the sorted state and row count under the TVList monitor when preparing a working memtable TVList for query.
  • Keep the query-visible row count consistent with the sorted snapshot so later query sorting does not mutate indices beyond an older iterator snapshot.

Root Cause

The query context lock only protects query ownership metadata, not TVList row count, sorted state, writes, or sort operations. A query could share a currently sorted mutable working TVList while recording a row count from a different moment, allowing a later query sort to reorder indices used by an older iterator.

Validation

Not run, per local workflow instruction.

@sonarqubecloud
Copy link
Copy Markdown

@shuwenwei shuwenwei closed this May 18, 2026
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