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

Recreate MRD in case of any error #2970

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

Conversation

abhishek10004
Copy link
Collaborator

@abhishek10004 abhishek10004 commented Feb 5, 2025

Changes to ensure MRD is recreated if any error is thrown from the Add call as well. Currently, after successful recreation of MRD, we are not recreating it.

Using a new variable to determine creation of MRD (instead of setting it to nil) to simplify the code (i.e. to prevent an additional mutex lock before calling add)

Performance testing: Tested random read with 50 threads for 1M/128K block size and there is no regression. Also tested the parallel read scenario (50 threads randomly reading from the same file) and there's no regression in this scenario as well.

b/394500981

@abhishek10004 abhishek10004 added execute-perf-test Execute performance test in PR execute-integration-tests Run only integration tests labels Feb 5, 2025
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

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

Project coverage is 75.14%. Comparing base (7cf94ae) to head (4c3ebd1).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
internal/gcsx/multi_range_downloader_wrapper.go 71.42% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2970      +/-   ##
==========================================
- Coverage   75.21%   75.14%   -0.07%     
==========================================
  Files         125      125              
  Lines       17734    17745      +11     
==========================================
- Hits        13339    13335       -4     
- Misses       3831     3843      +12     
- Partials      564      567       +3     
Flag Coverage Δ
unittests 75.14% <71.42%> (-0.07%) ⬇️

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.

@abhishek10004 abhishek10004 marked this pull request as ready for review February 5, 2025 09:02
@abhishek10004 abhishek10004 requested a review from a team as a code owner February 5, 2025 09:02
@kislaykishore kislaykishore requested review from a team, gargnitingoogle and tritone and removed request for a team and gargnitingoogle February 5, 2025 09:03
@@ -220,6 +232,9 @@ func (mrdWrapper *MultiRangeDownloaderWrapper) Read(ctx context.Context, buf []b

if e != nil && e != io.EOF {
e = fmt.Errorf("Error in Add Call: %w", e)
mrdWrapper.muCreateMRD.Lock()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Couple of things:

  1. We shouldn't create mrd on every error. Should be created only when mrd is closed by go-sdk.
  2. If there are x callbacks failed on the mrd, then we end up creating mrd x number of times even with the muCreateMRD lock. This is the thing which we wanted to avoid in the first place and didn't take this route.

Lets work with go-sdk in coming up with the right solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execute-integration-tests Run only integration tests execute-perf-test Execute performance test in PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants