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 race conditions in bulk loader and export #3697

Merged
merged 17 commits into from
Jul 22, 2019
Merged

Conversation

gitlw
Copy link

@gitlw gitlw commented Jul 19, 2019

fixes #3693 which is about concurrent write to an err variable by multiple go routines that are triggered via the StreamWriter.KeyToList function

also fixes reported race conditions in the bulk loader by avoiding concurrent calls to StreamWriter.Write


This change is Reviewable

@gitlw gitlw requested review from manishrjain and a team as code owners July 19, 2019 23:42
Copy link
Contributor

@martinmr martinmr left a comment

Choose a reason for hiding this comment

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

I am confused by the diff (specifically the export.go file). It looks like it includes changes from https://github.com/dgraph-io/dgraph/pull/3682/files. Am I missing something?

Reviewed 2 of 3 files at r1.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @gitlw and @manishrjain)


dgraph/cmd/bulk/reduce.go, line 138 at r1 (raw file):

 send 

sends


dgraph/cmd/bulk/reduce.go, line 139 at r1 (raw file):

iterating 

iterating over

Copy link
Contributor

@martinmr martinmr left a comment

Choose a reason for hiding this comment

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

Nevermind, I noticed you merged the other changes from master.

Now other than the couple of minor fixes I noticed, it :lgtm:

Reviewed 1 of 3 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gitlw and @manishrjain)


worker/export.go, line 529 at r2 (raw file):

		case pk.IsData():
			// defining a local error variable to avoid concurrent write

minor: uppercase and period.

@gitlw gitlw merged commit a1e3681 into master Jul 22, 2019
@gitlw gitlw deleted the gitlw/fix_race_conditions branch July 22, 2019 17:46
@manishrjain
Copy link
Contributor

manishrjain commented Jul 22, 2019

Hey @gitlw , this looks like a significant change (a good change, tbh). Definitely not a NOOP, so should have been reviewed by me.

Did you do benchmarks with your changes? It might have some impact.

@gitlw
Copy link
Author

gitlw commented Jul 22, 2019

@manishrjain Will run the benchmarks, and will refrain from merging without your LGTM (sorry about that).

gitlw pushed a commit that referenced this pull request Jul 22, 2019
gitlw pushed a commit that referenced this pull request Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Data races with export
3 participants