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

Add segment end criteria check for SVForwardIndex and Dictionary #15120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lnbest0707-uber
Copy link
Contributor

enhancement ingestion
Inspired by #14479
Apart from the MVForwardIndex check added in that PR, this PR adds similar check for SVForwardIndex and Dictionary. The PR only adds the interface and UTs.
The actual check policy is not within this PR and could be an open question to discuss. The end criteria needs to consider

  • ForwardIndex would end in a 4GB limit once converted into immutable segment.
  • Dictionary has its cardinality limit

While it is tricky to make it correct as:

  • 4GB limit is a compressed size, during ingestion into mutable segment, it cannot predict the correct compression ratio
  • With optimizeDictionary enabled, Dictionary encoding could also end in immutable forward index. It would be even harder to guess
    - If Dictionary would be converted to ForwardIndex
    - If converted, what would be the final compressed size

Some proposed policies:

  • Make the uncompressed size limit configurable, relying on that value to set the mutable segment's threshold.
  • Use the last segment's compression ratio as reference to predict current segment's.
  • For dictionary, use the same policy (but maybe a larger number by config) as the forward index.

@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 86.66667% with 6 lines in your changes missing coverage. Please review.

Project coverage is 63.42%. Comparing base (59551e4) to head (d00eaef).
Report is 1753 commits behind head on master.

Files with missing lines Patch % Lines
...local/indexsegment/mutable/MutableSegmentImpl.java 88.63% 1 Missing and 4 partials ⚠️
...t/segment/spi/index/mutable/MutableDictionary.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #15120      +/-   ##
============================================
+ Coverage     61.75%   63.42%   +1.66%     
- Complexity      207     1480    +1273     
============================================
  Files          2436     2748     +312     
  Lines        133233   154453   +21220     
  Branches      20636    23815    +3179     
============================================
+ Hits          82274    97955   +15681     
- Misses        44911    49093    +4182     
- Partials       6048     7405    +1357     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.41% <86.66%> (+1.70%) ⬆️
java-21 63.31% <86.66%> (+1.68%) ⬆️
skip-bytebuffers-false 63.41% <86.66%> (+1.67%) ⬆️
skip-bytebuffers-true 55.86% <20.00%> (+28.13%) ⬆️
temurin 63.42% <86.66%> (+1.66%) ⬆️
unittests 63.41% <86.66%> (+1.66%) ⬆️
unittests1 56.02% <20.00%> (+9.13%) ⬆️
unittests2 33.98% <86.66%> (+6.25%) ⬆️

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.

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.

2 participants