Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default memory allocation for consuming segments from on-heap to off-heap #8380

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

mayankshriv
Copy link
Contributor

@mayankshriv mayankshriv commented Mar 22, 2022

Description

It has been observed as well as established across several production deployments
that allocating consuming segments off-heap is better than allocating on-heap.

  • Modifying the default value of pinot.server.instance.realtime.alloc.offheap to true.
  • Note, that the default off-heap setting implies MMAP, and we still require setting
    pinot.server.instance.realtime.alloc.offheap.direct to true if using DirectMemory
    is preferred over MMAP.

Upgrade Notes

Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)

  • Yes (Please label as backward-incompat, and complete the section below on Release Notes)

Does this PR fix a zero-downtime upgrade introduced earlier?

  • Yes (Please label this as backward-incompat, and complete the section below on Release Notes)

Does this PR otherwise need attention when creating release notes? Things to consider:

  • New configuration options
  • Deprecation of configurations
  • Signature changes to public methods/interfaces
  • New plugins added or old plugins removed
  • Yes (Please label this PR as release-notes and complete the section on Release Notes)

Release Notes

The default behavior of pinot.server.instance.realtime.alloc.offheap has been changed to true.
This implies that memory for consuming segments will be allocated off-heap. Off-heap here defaults
to MMAP, and can be changed to DirectMemory by setting the confing
pinot.server.instance.realtime.alloc.offheap.direct to true.

Documentation

…to off-heap.

It has been observed as well as established across several production deployments
that allocating consuming segments off-heap is better than allocating on-heap.

- Modifying the default value of `pinot.server.instance.realtime.alloc.offheap` to true.
- Note, that the default off-heap setting implies MMAP, and we still require setting
  `pinot.server.instance.realtime.alloc.offheap.direct` to true if using DirectMemory
  is preferred over MMAP.
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

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

LGTM. We should also change some integration tests to turn it off so that both off-heap and on-heap is covered.
We can probably enable on-heap for RealtimeClusterIntegrationTest

@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2022

Codecov Report

Merging #8380 (3e2a673) into master (2d809ff) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #8380      +/-   ##
============================================
- Coverage     69.75%   69.74%   -0.02%     
- Complexity     4212     4274      +62     
============================================
  Files          1653     1653              
  Lines         86615    86615              
  Branches      13080    13080              
============================================
- Hits          60420    60407      -13     
- Misses        21966    21981      +15     
+ Partials       4229     4227       -2     
Flag Coverage Δ
integration1 28.58% <100.00%> (+0.03%) ⬆️
unittests1 66.98% <ø> (-0.01%) ⬇️
unittests2 14.10% <ø> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
.../starter/helix/HelixInstanceDataManagerConfig.java 79.54% <100.00%> (ø)
...ore/query/scheduler/resources/ResourceManager.java 85.71% <0.00%> (-10.72%) ⬇️
...nction/DistinctCountBitmapAggregationFunction.java 47.66% <0.00%> (-7.26%) ⬇️
.../helix/core/minion/MinionInstancesCleanupTask.java 77.27% <0.00%> (-4.55%) ⬇️
...pache/pinot/core/query/optimizer/filter/Range.java 95.91% <0.00%> (-4.09%) ⬇️
.../pinot/core/query/scheduler/PriorityScheduler.java 78.08% <0.00%> (-2.74%) ⬇️
...nMaxValueBasedSelectionOrderByCombineOperator.java 68.18% <0.00%> (-2.28%) ⬇️
.../helix/core/realtime/SegmentCompletionManager.java 72.00% <0.00%> (-1.02%) ⬇️
...t/core/query/selection/SelectionOperatorUtils.java 91.85% <0.00%> (-0.33%) ⬇️
...manager/realtime/LLRealtimeSegmentDataManager.java 69.31% <0.00%> (-0.27%) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d809ff...3e2a673. Read the comment docs.

@mcvsubbu mcvsubbu added the Configuration Config changes (addition/deletion/change in behavior) label Mar 22, 2022
@snleee
Copy link
Contributor

snleee commented Mar 22, 2022

Can you mark backward-incompat + release label?

@snleee snleee added release-notes Referenced by PRs that need attention when compiling the next release notes backward-incompat Referenced by PRs that introduce or fix backward compat issues labels Mar 22, 2022
@mayankshriv mayankshriv merged commit 2d5cbf7 into apache:master Mar 22, 2022
@mayankshriv mayankshriv deleted the offheap branch March 22, 2022 19:38
@mayankshriv
Copy link
Contributor Author

LGTM. We should also change some integration tests to turn it off so that both off-heap and on-heap is covered. We can probably enable on-heap for RealtimeClusterIntegrationTest

Filed #8385 to add test coverage for on-heap.

mayankshriv added a commit to mayankshriv/pinot that referenced this pull request Mar 22, 2022
With PR apache#8380, we modified the default value for
`pinot.server.instance.realtime.alloc.offheap` to use off-heap. Explicitly setting
it to use on-heap in some of the integration tests for coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backward-incompat Referenced by PRs that introduce or fix backward compat issues Configuration Config changes (addition/deletion/change in behavior) release-notes Referenced by PRs that need attention when compiling the next release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants