-
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
server: data race in (*diskStatsMap).initDiskStatsMap()
#91414
Comments
@knz assigned this to you as you recently changed that code. Feel free to reassign as you see fit, if necessary. Thank you. |
TestClusterConnectivity
(*diskStatsMap).initDiskStatsMap()
(*diskStatsMap).initDiskStatsMap()
(*diskStatsMap).initDiskStatsMap()
@sumeerbhola — do you mind taking a look here? looks like a race in the admission control disk-stats during node initialization |
The race is because the call that initializes the cockroach/pkg/server/server.go Line 1784 in 8b1be12
which is after the call to SetPebbleMetricsProvider at cockroach/pkg/server/server.go Line 1672 in 8b1be12
Both these calls are in Server.PreStart .
I can hoist the latter above the former. But the positioning of the latter was not done with much knowledge, so there may be other bugs in this sequencing: specifically, the initialization of |
@irfansharif can you perhaps chime in on sumeer's question here? |
Also seen here #99567. |
Yes, this is correct. However, the startup sequence contains logic that blocks it from completing until the store IDs are known. state, initialStart, err ≔ initServer.ServeAndWait(...) This makes the Currently, both the calls to We can invert their ordering, as long as they remain in
Very theoretically, yes, but we would need to patch a few loose ends before it can fully work. |
ok here's a PR: #101097 |
Fixes cockroachdb#91414. Fixes cockroachdb#101010. Fixes cockroachdb#100902. The call to registerEnginesForDiskStatsMap needs to wait until the store IDs are known. Release note: None
Fixes cockroachdb#91414. Fixes cockroachdb#101010. Fixes cockroachdb#100902. There was a race between registerEnginesForDiskStatsMap and SetPebbleMetricsProvider, the latter making use of a map constructed by the former but appeared in the opposite order in code. Release note: None
101148: server: (re-)fix data race in server initialization r=irfansharif a=irfansharif Fixes #91414. Fixes #101010. Fixes #100902. There was a race between registerEnginesForDiskStatsMap and SetPebbleMetricsProvider, the latter making use of a map constructed by the former but appeared in the opposite order in code. Release note: None Co-authored-by: irfan sharif <[email protected]>
This data race is sometimes observed when
TestClusterConnectivity
is run with the race detector enabled:Jira issue: CRDB-21249
The text was updated successfully, but these errors were encountered: