Skip to content

Fix wrong interval for OOM protection#17753

Merged
Jackie-Jiang merged 1 commit intoapache:masterfrom
Jackie-Jiang:fix_resource_accounting
Feb 24, 2026
Merged

Fix wrong interval for OOM protection#17753
Jackie-Jiang merged 1 commit intoapache:masterfrom
Jackie-Jiang:fix_resource_accounting

Conversation

@Jackie-Jiang
Copy link
Contributor

  • Track sleep time separately for query resource tracking and workload resource tracking
  • Fix the super frequent workload resource tracking (change default interval from 1ms to 100ms)
  • Do not track workload resource when WorkloadBudgetManager is disabled

Behavior Change

@Jackie-Jiang Jackie-Jiang added bugfix oom-protection needs-attention Used for sensitive changes - allows searching PRs post release to narrow down causes for regression. labels Feb 24, 2026
@Jackie-Jiang
Copy link
Contributor Author

@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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 1.69492% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.20%. Comparing base (739043c) to head (faf67b2).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...ore/accounting/ResourceUsageAccountantFactory.java 0.00% 44 Missing ⚠️
...he/pinot/spi/accounting/WorkloadBudgetManager.java 8.33% 6 Missing and 5 partials ⚠️
...ot/core/accounting/WorkloadResourceAggregator.java 0.00% 3 Missing ⚠️
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     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.15% <1.69%> (-0.03%) ⬇️
java-21 63.18% <1.69%> (-0.01%) ⬇️
temurin 63.20% <1.69%> (-0.03%) ⬇️
unittests 63.19% <1.69%> (-0.03%) ⬇️
unittests1 55.58% <1.69%> (+0.02%) ⬆️
unittests2 34.06% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Jackie-Jiang Jackie-Jiang merged commit 3132cfc into apache:master Feb 24, 2026
20 checks passed
@Jackie-Jiang Jackie-Jiang deleted the fix_resource_accounting branch February 24, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix needs-attention Used for sensitive changes - allows searching PRs post release to narrow down causes for regression. oom-protection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants