cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

server,admission: fix close and read race on DiskStatsMonitor

Open sumeerbhola opened this issue 1 year ago • 1 comments
trafficstars

The diskStatsMap owns its DiskStatsMonitors, but it is closed from a different path than the StoreGrantCoordinators which calls read methods on the diskStatsMap (via the PebbleMetricsProvider interface). This causes a rare shutdown race, which fails a unit test. This is fixed by adding a Close method on PebbleMetricsProvider, to align the usage and closing. The nodePebbleMetricsProvider implements this interface, instead of directly implementing it by Node.

There is some minor cleanup permitted by this. Node does not need a diskStatsMap member. StoreGrantCoordinators does not need a PebbleMetricsProvider member.

Fixes #128958

Epic: none

Release note: None

sumeerbhola avatar Aug 28 '24 20:08 sumeerbhola

This change is Reviewable

cockroach-teamcity avatar Aug 28 '24 20:08 cockroach-teamcity

TFTR!

sumeerbhola avatar Aug 29 '24 12:08 sumeerbhola

bors r=aadityasondhi

sumeerbhola avatar Aug 29 '24 12:08 sumeerbhola