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

ddl: fix gofail data race #6904

Merged
merged 2 commits into from
Jun 25, 2018
Merged

ddl: fix gofail data race #6904

merged 2 commits into from
Jun 25, 2018

Conversation

winkyao
Copy link
Contributor

@winkyao winkyao commented Jun 25, 2018

Fix #6897 data race

@coocood
Copy link
Member

coocood commented Jun 25, 2018

LGTM

@@ -690,7 +690,7 @@ func (w *addIndexWorker) run(d *ddlCtx) {

log.Debug("[ddl-reorg] got backfill index task:#v", task)
// gofail: var mockAddIndexErr bool
//if mockAddIndexErr && !gofailMockAddindexErrOnceGuard && w.id == 0 {
//if w.id == 0 && mockAddIndexErr && !gofailMockAddindexErrOnceGuard {
Copy link
Member

Choose a reason for hiding this comment

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

Why could this fix the race?

Copy link
Member

Choose a reason for hiding this comment

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

If the worker id is not 0, it will never access the gofailMockAddindexErrOnceGuard variable.

@shenli
Copy link
Member

shenli commented Jun 25, 2018

LGTM

@shenli
Copy link
Member

shenli commented Jun 25, 2018

/run-all-tests

@shenli shenli added status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug. component/test labels Jun 25, 2018
@coocood coocood merged commit 41f8ac1 into pingcap:master Jun 25, 2018
@winkyao winkyao deleted the fix_data_race branch June 26, 2018 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants