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

lucene IndexOutOfBounds bugfix, and use NRTCachingDirectory for realtime segment #13308

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

itschrispeck
Copy link
Collaborator

@itschrispeck itschrispeck commented Jun 4, 2024

This PR contains two changes:

  1. Prevent duplicates in the realtime Lucene index to fix IndexOutOfBounds query time exceptions
  2. Use NRTCachingDirectory for the realtime segment

The first is a symptom of a crash post .commit(), as leftover Lucene index files are appended to as opposed to overwritten . I had seen IndexOutOfBounds exception is caused by mappingBuffer.getInt(luceneDocId), but the mapping file is loaded in range [0, numDocsFromSegment * 4 bytes]. Therefore, if Lucene index contains duplicates, it's an eventuality that we'll try to getInt for a luceneDocId that is larger than numDocsFromSegment, causing the exception.

For the second, NRT functionality is beneficial when refresh rate is high as it results in many tiny files being written. This allows for a configurable in memory buffer to cache these small writes and avoid many small files/high FDs.

Tested in an internal cluster.

suggested tags: bugfix, enhancement

@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.09%. Comparing base (59551e4) to head (5b2c9e0).
Report is 546 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13308      +/-   ##
============================================
+ Coverage     61.75%   62.09%   +0.34%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2536     +100     
  Lines        133233   139326    +6093     
  Branches      20636    21542     +906     
============================================
+ Hits          82274    86515    +4241     
- Misses        44911    46328    +1417     
- Partials       6048     6483     +435     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 62.07% <100.00%> (+0.36%) ⬆️
java-21 61.97% <100.00%> (+0.35%) ⬆️
skip-bytebuffers-false 62.08% <100.00%> (+0.34%) ⬆️
skip-bytebuffers-true 61.93% <100.00%> (+34.20%) ⬆️
temurin 62.09% <100.00%> (+0.34%) ⬆️
unittests 62.09% <100.00%> (+0.34%) ⬆️
unittests1 46.65% <0.00%> (-0.24%) ⬇️
unittests2 27.77% <100.00%> (+0.04%) ⬆️

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.

@Jackie-Jiang Jackie-Jiang merged commit fc9f34f into apache:master Jun 4, 2024
18 of 20 checks passed
gortiz pushed a commit to gortiz/pinot that referenced this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants