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

Unblocks helix thread for online segment #15246

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

noob-se7en
Copy link
Contributor

@noob-se7en noob-se7en commented Mar 11, 2025

Problem
Consider a scenario for Realtime Tables where there is a slow server and a fast server where fast server commits multiple segments but slow server is still consuming an old segment.

Slow server might run into a situation like below:
Screenshot 2025-03-11 at 6 09 55 PM

(since segments are not consumed in strict order based on sequence number, some later segment's consuming thread can block Helix transition thread of an older segment.)

Solution
Change semaphore acquire logic such that if a Helix threads fails to acquire the semaphore, check if the fast server has already committed the segment. If yes, simply return as eventually the slow server will receive a consuming -> online state transition message for the same segment.

(Currently dedup and partial-upsert enabled tables are being ignored for this problem because we want to ensures that new segment is not downloaded until the previous consuming segment releases the semaphore. (Although there is an existing bug in dedup and upsert where strict order of segment consumption is not guaranteed)).

@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2025

Codecov Report

Attention: Patch coverage is 12.00000% with 22 lines in your changes missing coverage. Please review.

Project coverage is 63.60%. Comparing base (59551e4) to head (0ad013f).
Report is 1836 commits behind head on master.

Files with missing lines Patch % Lines
...a/manager/realtime/RealtimeSegmentDataManager.java 16.66% 14 Missing and 1 partial ⚠️
...ata/manager/realtime/RealtimeTableDataManager.java 0.00% 5 Missing ⚠️
...anager/realtime/SegmentAlreadyExistsException.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #15246      +/-   ##
============================================
+ Coverage     61.75%   63.60%   +1.85%     
- Complexity      207     1459    +1252     
============================================
  Files          2436     2773     +337     
  Lines        133233   156263   +23030     
  Branches      20636    23985    +3349     
============================================
+ Hits          82274    99390   +17116     
- Misses        44911    49384    +4473     
- Partials       6048     7489    +1441     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 ?
java-11 63.58% <12.00%> (+1.87%) ⬆️
java-21 63.50% <12.00%> (+1.88%) ⬆️
skip-bytebuffers-false 63.59% <12.00%> (+1.85%) ⬆️
skip-bytebuffers-true 63.48% <12.00%> (+35.75%) ⬆️
temurin 63.60% <12.00%> (+1.85%) ⬆️
unittests 63.60% <12.00%> (+1.85%) ⬆️
unittests1 56.13% <12.00%> (+9.24%) ⬆️
unittests2 34.17% <0.00%> (+6.43%) ⬆️

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:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@noob-se7en noob-se7en marked this pull request as ready for review March 11, 2025 12:32
Comment on lines -1687 to -1688
_allowConsumptionDuringCommit = !_realtimeTableDataManager.isPartialUpsertEnabled() ? true
: _tableConfig.getUpsertConfig().isAllowPartialUpsertConsumptionDuringCommit();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why is this not checking for dedup?

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