apache / apache/druid

Fix concurrency of DerivativeDataSourceManager

Open
#8,111 0 comments 0 reactions 0 assignees View on GitHub
Improvement
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

- `derivativesRef` shouldn't be static
- Seems that `derivativesRef` shouldn't be atomic; volatile would suffice. This looks like an example of https://github.com/code-review-checklists/java-concurrency#redundant-atomics
- `derivativesRef` doesn't need to store a `ConcurrentHashMap`, a simple `HashMap` would suffice

FYI @zhangxinyu1

Contributor guide

Open the contributing guide

Research direction

Locate DerivativeDataSourceManager and trace every access to derivativesRef, including how instances are created and updated. Verify the requested non-static, volatile reference and simpler map choice against the manager's concurrency behavior, then run the relevant existing Druid tests; done means the requested changes are covered without introducing unsafe concurrent access.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.