Skip to content

fix(server): data race when accessing the db scan infos in GetLatestKeyNumStats#3414

Merged
git-hulk merged 2 commits into
apache:unstablefrom
songqing:fix/data-race-get-latest-key-num-stats
Apr 1, 2026
Merged

fix(server): data race when accessing the db scan infos in GetLatestKeyNumStats#3414
git-hulk merged 2 commits into
apache:unstablefrom
songqing:fix/data-race-get-latest-key-num-stats

Conversation

@songqing

@songqing songqing commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

db_scan_infos_.find() was called without holding db_job_mu_, while
background threads mutate the map under that lock. Acquire the lock
before find() to match the pattern used in GetLastScanTime.

@git-hulk git-hulk changed the title fix(server): fix data race in GetLatestKeyNumStats fix(server): data race when accessing the db scan infos in GetLatestKeyNumStats Apr 1, 2026
@git-hulk git-hulk enabled auto-merge (squash) April 1, 2026 06:02
@git-hulk git-hulk merged commit da5e463 into apache:unstable Apr 1, 2026
104 of 109 checks passed
@sonarqubecloud

sonarqubecloud Bot commented Apr 1, 2026

Copy link
Copy Markdown

nagisa-kunhah pushed a commit to nagisa-kunhah/kvrocks that referenced this pull request Apr 29, 2026
…eyNumStats (apache#3414)

db_scan_infos_.find() was called without holding db_job_mu_, while
    background threads mutate the map under that lock. Acquire the lock
    before find() to match the pattern used in GetLastScanTime.

Co-authored-by: hulk <hulk.website@gmail.com>
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.

3 participants