-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
storage: TestReplicateQueueDownReplicate failed under stress #31535
Comments
looks similar to the race in #30483 (comment) |
How is there possibly a race here? Is there some code path where we're using a statically allocated error? |
Hmm, possibly: |
That seems like a good candidate. And likely the only one (the DistSender one is high enough in the stack to be OK though I don't trust that one neither)
|
Lovely, we have code in
|
@tschottdorf Are you able to reproduce a failure with either |
Heh, someone must've been too lazy to introduce a new ErrorDetail.
If I ever was then it has been lost to the sands of time. But I usually post when I manage to repro. A case for |
I'm actually not seeing a code path where |
Perhaps this is the These |
I managed to reproduce with |
Also, I added instrumentation to detect if |
Hmm, strangely none of my instrumentation to detect the |
Wouldn't it be nice if you could write code like |
Yes. I want that. I'll get this figured out, its just irritating to reproduced. I didn't see a reproduction with the instrumentation I added last night. Probably because it produced copious logs. |
Made a bit more progress on this:
[It's odd that the race detector goroutine IDs do not match up with the log messages. That is repeatable and worth understanding.] The log messages indicate this is definitely not occurring for the two singleton
Seems pretty clear what is going on. We're sharing an error across multiple proposals. Easy to fix. |
Do you have the full message for this failure? |
Here you go:
|
Replica.cancelPendingCommandsLocked was sharing an error across multiple proposals. This is problematic because Store.Send mutates Error.Now. Fixes cockroachdb#31535 Fixes cockroachdb#30483 Release note: None
31631: storage: do not share an error across proposals r=benesch a=petermattis Replica.cancelPendingCommandsLocked was sharing an error across multiple proposals. This is problematic because Store.Send mutates Error.Now. Fixes #31535 Fixes #30483 Release note: None Co-authored-by: Peter Mattis <[email protected]>
Replica.cancelPendingCommandsLocked was sharing an error across multiple proposals. This is problematic because Store.Send mutates Error.Now. Fixes cockroachdb#31535 Fixes cockroachdb#30483 Release note: None
Spawned from cockroachdb#31535 (comment). ``` [tschottdorf@toblerone cockroach (fix/race-goroutine-id)]$ make testrace PKG=./pkg/testutils Running make with -j8 GOPATH set to /Users/tschottdorf/go go test -race -tags ' make x86_64_apple_darwin18.0.0' -ldflags '-X github.com/cockroachdb/cockroach/pkg/build.typ=development -extldflags "" -X "github.com/cockroachdb/cockroach/pkg/build.tag=v2.2.0-alpha.00000000-1804-g91b9c04cfe-dirty" -X "github.com/cockroachdb/cockroach/pkg/build.rev=91b9c04cfe72a501e084cd21eaf44569b19e5d56" -X "github.com/cockroachdb/cockroach/pkg/build.cgoTargetTriple=x86_64-apple-darwin18.0.0" ' -run "." -timeout 25m ./pkg/testutils I181019 16:29:57.839687 26 testutils/error_test.go:43 my id is 26 I181019 16:29:57.839720 27 testutils/error_test.go:43 my id is 27 goroutine 26 [running]: runtime/debug.Stack(0x4bcef99, 0xc000070e70, 0x404fe5f) /usr/local/Cellar/go/1.11.1/libexec/src/runtime/debug/stack.go:24 +0xb5 runtime/debug.PrintStack() /usr/local/Cellar/go/1.11.1/libexec/src/runtime/debug/stack.go:16 +0x34 github.com/cockroachdb/cockroach/pkg/testutils.TestGoroutine.func1() /Users/tschottdorf/go/src/github.com/cockroachdb/cockroach/pkg/testutils/error_test.go:45 +0x129 github.com/cockroachdb/cockroach/pkg/testutils.TestGoroutine(0xc000190300) /Users/tschottdorf/go/src/github.com/cockroachdb/cockroach/pkg/testutils/error_test.go:51 +0x127 testing.tRunner(0xc000190300, 0x4e66458) /usr/local/Cellar/go/1.11.1/libexec/src/testing/testing.go:827 +0x163 created by testing.(*T).Run /usr/local/Cellar/go/1.11.1/libexec/src/testing/testing.go:878 +0x651 goroutine 27 [running]: runtime/debug.Stack(0x4bcef99, 0xc000531f38, 0x404fe5f) /usr/local/Cellar/go/1.11.1/libexec/src/runtime/debug/stack.go:24 +0xb5 runtime/debug.PrintStack() /usr/local/Cellar/go/1.11.1/libexec/src/runtime/debug/stack.go:16 +0x34 github.com/cockroachdb/cockroach/pkg/testutils.TestGoroutine.func1() /Users/tschottdorf/go/src/github.com/cockroachdb/cockroach/pkg/testutils/error_test.go:45 +0x129 created by github.com/cockroachdb/cockroach/pkg/testutils.TestGoroutine /Users/tschottdorf/go/src/github.com/cockroachdb/cockroach/pkg/testutils/error_test.go:50 +0x11d ================== WARNING: DATA RACE Write at 0x00c0000ba1a8 by goroutine 24: github.com/cockroachdb/cockroach/pkg/testutils.TestGoroutine.func1() /Users/tschottdorf/go/src/github.com/cockroachdb/cockroach/pkg/testutils/error_test.go:47 +0x138 Previous write at 0x00c0000ba1a8 by goroutine 23: github.com/cockroachdb/cockroach/pkg/testutils.TestGoroutine.func1() /Users/tschottdorf/go/src/github.com/cockroachdb/cockroach/pkg/testutils/error_test.go:47 +0x138 github.com/cockroachdb/cockroach/pkg/testutils.TestGoroutine() /Users/tschottdorf/go/src/github.com/cockroachdb/cockroach/pkg/testutils/error_test.go:51 +0x126 testing.tRunner() /usr/local/Cellar/go/1.11.1/libexec/src/testing/testing.go:827 +0x162 Goroutine 24 (running) created at: github.com/cockroachdb/cockroach/pkg/testutils.TestGoroutine() /Users/tschottdorf/go/src/github.com/cockroachdb/cockroach/pkg/testutils/error_test.go:50 +0x11c testing.tRunner() /usr/local/Cellar/go/1.11.1/libexec/src/testing/testing.go:827 +0x162 Goroutine 23 (running) created at: testing.(*T).Run() /usr/local/Cellar/go/1.11.1/libexec/src/testing/testing.go:878 +0x650 testing.runTests.func1() /usr/local/Cellar/go/1.11.1/libexec/src/testing/testing.go:1119 +0xa8 testing.tRunner() /usr/local/Cellar/go/1.11.1/libexec/src/testing/testing.go:827 +0x162 testing.runTests() /usr/local/Cellar/go/1.11.1/libexec/src/testing/testing.go:1117 +0x4ee testing.(*M).Run() /usr/local/Cellar/go/1.11.1/libexec/src/testing/testing.go:1034 +0x2ee main.main() _testmain.go:56 +0x221 ================== FAIL github.com/cockroachdb/cockroach/pkg/testutils 1.107s make: *** [testrace] Error 1 ``` Release note: None
#31639 for the goroutine IDs. |
SHA: https://github.com/cockroachdb/cockroach/commits/2cbfb514fed209e9e4192bd07af6baa8dd073bab
Parameters:
To repro, try:
Failed test: https://teamcity.cockroachdb.com/viewLog.html?buildId=971557&tab=buildLog
The text was updated successfully, but these errors were encountered: