cockroachdb / cockroachdb/cockroach
storage: investigate fsync latency spikes
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
We've seen many instances of fsync latency spikes in cloud clusters (including in cockroachlabs/support#2395). These fsync latency spikes can be 10+ seconds long, but without being the 20 seconds necessary to trigger disk stall detection to terminate the node.
These fsync latency stalls can be extremely disruptive to the cluster. In cockroachlabs/support#2395 overall throughput tanked as eventually every worker in the bounded worker pool becomes stuck on some operation waiting for the slow disk. There are issues (eg, #88699) already tracking the work to reduce the impact of one node's slow disk on overall cluster throughput. But I think there's something additional to investigate with respect to cloud platforms and why these stalls occur.
* Is our volume of in-progress IOPS highly variable, and we momentarily exhaust IOPS limit resulting in throttling? If so cockroachdb/pebble#18 could help ensure we avoid starving the WAL writer through saturating IOPS.
* Is it possible there's something within the process introducing latency between the point at which fsync is measured (eg, the Pebble `LogWriter.flushLoop`) and the fsync itself? This seems unlikely. Although we have non-trivial logic within the VFS stack, the fsync codepaths are very minimal and contain no locking.
We should try to reproduce across cloud providers and investigate. For example, write a roachtest that demonstrates the issues mentioned above.
Informs #107623.
Jira issue: CRDB-29450
Contributor guide
Assessment
This issue has not been assessed yet.