-
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
pkg/sql/sqlstats/persistedsqlstats/persistedsqlstats_test: TestPersistedSQLStatsReadDisk failed #138224
Comments
Full race condition stack trace:
|
This doesn't seem to have been caused by any recent change, so removed the release-blocker |
@kyle-a-wong I think this is happening because the test is iterating through stats objects that were copied incorrectly from the in-memory containers where stuff is modified concurrently. I think it boils down to this code: cockroach/pkg/sql/sqlstats/ssmemstorage/ss_mem_iterator.go Lines 79 to 103 in 2729738
On line 80 we copy the |
StmtStatsIterator.Next() copies the next statement stats info into a new CollectedStatementStatistics object, but the slice fields of stmtStats.mu.data are not copied explicitly. This makes them susecptible to race conditions, as seen in cockroachdb#138224. To fix, all slice fields in the StatementStatistics are explicitly copied, using a new util.CopySlice function. Fixes: 138224 Epic: none Release note: none
StmtStatsIterator.Next() copies the next statement stats info into a new CollectedStatementStatistics object, but the slice fields of stmtStats.mu.data are not copied explicitly. This makes them susecptible to race conditions, as seen in cockroachdb#138224. To fix, all slice fields in the StatementStatistics are explicitly copied, using slices.Clone. Fixes: 138224 Epic: none Release note: none
StmtStatsIterator.Next() copies the next statement stats info into a new CollectedStatementStatistics object, but the slice fields of stmtStats.mu.data are not copied explicitly. This makes them susecptible to race conditions, as seen in cockroachdb#138224. To fix, all slice fields in the StatementStatistics are explicitly copied, using slices.Clone. Fixes: 138224 Epic: none Release note: none
StmtStatsIterator.Next() copies the next statement stats info into a new CollectedStatementStatistics object, but the slice fields of stmtStats.mu.data are not copied explicitly. This makes them susecptible to race conditions, as seen in cockroachdb#138224. To fix, all slice fields in the StatementStatistics are explicitly copied, using slices.Clone. Fixes: 138224 Epic: none Release note: none
pkg/sql/sqlstats/persistedsqlstats/persistedsqlstats_test.TestPersistedSQLStatsReadDisk failed on release-24.3.3-rc @ 7dab2bb943152658ca94aeae83c450742ec361a5:
Parameters:
attempt=1
race=true
run=3
shard=6
Help
See also: How To Investigate a Go Test Failure (internal)
This test on roachdash | Improve this report!
Jira issue: CRDB-45958
The text was updated successfully, but these errors were encountered: