-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improved segment build time for Lucene text index realtime to offline conversion #12744
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12744 +/- ##
============================================
+ Coverage 61.75% 62.24% +0.49%
+ Complexity 207 198 -9
============================================
Files 2436 2503 +67
Lines 133233 136497 +3264
Branches 20636 21117 +481
============================================
+ Hits 82274 84964 +2690
- Misses 44911 45248 +337
- Partials 6048 6285 +237
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
4c42c6d
to
5e0d5c2
Compare
...java/org/apache/pinot/segment/local/segment/creator/impl/SegmentIndexCreationDriverImpl.java
Outdated
Show resolved
Hide resolved
@@ -74,7 +85,8 @@ public static HashSet<String> getDefaultEnglishStopWordsSet() { | |||
* @param column column name | |||
* @param segmentIndexDir segment index directory | |||
* @param commit true if the index should be committed (at the end after all documents have | |||
* been added), false if index should not be committed | |||
* been added), false if index should not be | |||
* @param sortedDocIds sortedDocIds from segment conversion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as my earlier comment on the naming. Also since this is a public method, we need more explanation and some example.
...al/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/pinot/segment/local/realtime/converter/RealtimeSegmentConverter.java
Outdated
Show resolved
Hide resolved
_indexCreator.getIndexWriter().commit(); | ||
} catch (Exception e) { | ||
LOGGER.error("Failed to commit the realtime lucene text index for column {}, exception {}", _column, | ||
e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just log the error e?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't quite follow this, can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant LOGGER.err("Failed.. .", _column, e);
...in/java/org/apache/pinot/segment/local/segment/creator/impl/text/LuceneTextIndexCreator.java
Outdated
Show resolved
Hide resolved
|
||
/** | ||
* Commits the mutable index artifacts to disk. This is used in preparation for realtime segment conversion. | ||
* commit() should perform any required actions before using mutable segment artifacts to optimize immutable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments in line 65-66 seem to be self-conflicting: commit to disk is just one possible action? the implementation can actually choose other action for preparation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit to disk should be the main mechanism for index reuse for any indexes using this path - disk is an intermediary. Other actions refers to actions a MutableIndex implementation might want to perform before writing some artifacts to disk
ce8f690
to
2bddff1
Compare
hi @itschrispeck is there a feature flag to disable this optimization? We found the heap usage got higher than before after upgrading to recent code. From server logs, we found "Reusing the realtime lucene index for segment" which led me here. And from heap dump, we found
We didn't config TextIndex for those tables across the upgrades, so I'd assume this optimization was enabled by default. So I'd like to check if there is a feature flag to disable this, so we can validate if this had caused the higher heap usage. If there is no such feature flag, I can try to add one for your review. I'm thinking to add one around here
|
Motivation/implementation doc: https://docs.google.com/document/d/1Leo4mQvR-6Gscseq50oqSnddX8Y3up6fnysKaly-eAU/edit?usp=sharing
Internally we've seen roughly 40-60% improvement in overall segment build time. The lower peaks are from a table/tenant with this change, the higher ingestion delay peaks are from an identical table in a tenant without this change:
Testing: deployed internally, local testing, validated basic pause/restart/reload operations on a table to ensure no regression in TextIndexHandler index build.
tags: ingestion
performance