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

release-20.1: workload/tpcc: fix race condition in scattering tables #56979

Merged
merged 1 commit into from
Nov 21, 2020

Conversation

thoszhang
Copy link
Contributor

Backport 1/1 commits from #56942.

/cc @cockroachdb/release


When iterating over the names of tables to scatter, we were sharing the
loop variable between the goroutines, which is racy and caused a test
failure due to reading a garbage string value for the table name. In
general, this function may not scatter each table exactly once. This PR
fixes the bug by moving the read out of the goroutine.

Closes #56892.

Release note (bug fix): Fixed a race condition in the tpcc workload
with the --scatter flag where tables could be scattered multiple times
or not at all.

When iterating over the names of tables to scatter, we were sharing the
loop variable between the goroutines, which is racy and caused a test
failure due to reading a garbage string value for the table name. In
general, this function may not scatter each table exactly once. This PR
fixes the bug by moving the read out of the goroutine.

Release note (bug fix): Fixed a race condition in the `tpcc` workload
with the `--scatter` flag where tables could be scattered multiple times
or not at all.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@thoszhang thoszhang merged commit e384e65 into cockroachdb:release-20.1 Nov 21, 2020
@thoszhang thoszhang deleted the backport20.1-56942 branch November 21, 2020 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants