Fix wrong interval for OOM protection#17753
Conversation
|
@vvivekiyer Can you please verify if the default 1ms workload tracking interval is a typo? It doesn't make much sense to track a 1 minute granularity budget with 1ms interval |
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical performance issue with workload resource tracking interval and refactors the resource aggregation logic to track query and workload resources independently.
Changes:
- Changed default workload sleep time from 1ms to 100ms (fixing likely typo from PR #15798)
- Refactored WatcherTask to track separate sleep times for query vs workload resource aggregation
- Made workload resource aggregator creation conditional on WorkloadBudgetManager being enabled
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java | Changed DEFAULT_WORKLOAD_SLEEP_TIME_MS from 1ms to 100ms; minor line formatting |
| pinot-spi/src/main/java/org/apache/pinot/spi/accounting/WorkloadBudgetManager.java | Renamed _isEnabled to _enabled; added public isEnabled() method |
| pinot-core/src/main/java/org/apache/pinot/core/accounting/WorkloadResourceAggregator.java | Updated constructor to take WorkloadBudgetManager parameter; added assertion check |
| pinot-core/src/main/java/org/apache/pinot/core/accounting/ResourceUsageAccountantFactory.java | Major refactoring: separate timing logic for query/workload aggregation, conditional workload aggregator creation, removed EnumMap dispatch pattern |
pinot-core/src/main/java/org/apache/pinot/core/accounting/ResourceUsageAccountantFactory.java
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/accounting/WorkloadResourceAggregator.java
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/accounting/ResourceUsageAccountantFactory.java
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/accounting/ResourceUsageAccountantFactory.java
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17753 +/- ##
============================================
- Coverage 63.22% 63.20% -0.03%
Complexity 1454 1454
============================================
Files 3176 3176
Lines 191002 191038 +36
Branches 29204 29216 +12
============================================
- Hits 120763 120740 -23
- Misses 60818 60876 +58
- Partials 9421 9422 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WorkloadBudgetManageris disabledBehavior Change