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

Fix bug to return validDocIDsMetadata from all servers #12431

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

tibrewalpratik17
Copy link
Contributor

@tibrewalpratik17 tibrewalpratik17 commented Feb 15, 2024

label:
bugfix

Fixes #12423

We were sending serverToEndpoints mapping instead of endpointsToServer which is expected by CompletionService. That's why CompletionService was always returning 1 server's response as it was having null as the only key in map and returning response of the last server it receives overwriting the response of previous server(s) always.

The impact of this bug was that getValidDocIdMetadata endpoint was always returning results from one server instead of the number of servers the table is actually hosted on. This affects UpsertCompaction task too as it now processes the segments of any 1 random server at a time instead of all.

Another bug fix from #12445

Currently, this endpoint tables/{tableName}/validDocIdsMetadata returns the validDocID metadata for the same segment multiple times (equal to number of replicas).

This causes issues with UpsertCompaction task too as the same segment starts getting processed multiple times (for deletion / compaction).

This patch dedupes the response of the API itself which is implicitly used by UpsertCompactionTaskGenerator too.

@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (1d490c1) 61.77% compared to head (c987ff1) 61.75%.
Report is 3 commits behind head on master.

Files Patch % Lines
...t/controller/util/ServerSegmentMetadataReader.java 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12431      +/-   ##
============================================
- Coverage     61.77%   61.75%   -0.02%     
  Complexity      207      207              
============================================
  Files          2436     2436              
  Lines        133130   133176      +46     
  Branches      20623    20632       +9     
============================================
+ Hits          82241    82246       +5     
- Misses        44850    44890      +40     
- Partials       6039     6040       +1     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (ø)
integration <0.01% <0.00%> (ø)
integration1 <0.01% <0.00%> (ø)
integration2 0.00% <0.00%> (ø)
java-11 34.94% <0.00%> (-26.75%) ⬇️
java-21 61.63% <0.00%> (-0.02%) ⬇️
skip-bytebuffers-false 61.73% <0.00%> (-0.01%) ⬇️
skip-bytebuffers-true 61.58% <0.00%> (-0.04%) ⬇️
temurin 61.75% <0.00%> (-0.02%) ⬇️
unittests 61.75% <0.00%> (-0.02%) ⬇️
unittests1 46.88% <ø> (-0.02%) ⬇️
unittests2 27.74% <0.00%> (-0.02%) ⬇️

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.

Copy link
Contributor

@ankitsultana ankitsultana left a comment

Choose a reason for hiding this comment

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

Good catch. @tibrewalpratik17 : can you also add what was the impact of this bug in the description?

@tibrewalpratik17
Copy link
Contributor Author

@snleee can you take a look at this fix for the tagged issue?

@snleee
Copy link
Contributor

snleee commented Feb 20, 2024

@tibrewalpratik17 can we combine this pr with #12445?

Copy link
Contributor

@snleee snleee left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for catching the issue.

@snleee snleee added the upsert label Feb 21, 2024
@snleee snleee merged commit d0ce68b into apache:master Feb 21, 2024
19 checks passed
@tibrewalpratik17 tibrewalpratik17 deleted the fix_uc_bug branch July 18, 2024 09:50
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.

CompletionServiceHelper's doMultiPostRequest returns whenever 1 server responds instead of waiting for all
4 participants