Describe the bug
In clusterSaveConfig(), there are synchronous I/O operations, including close() and rename(). If I/O is delayed or blocked, possibly by disk contention, this may result in large latencies on the Valkey main thread.
We should avoid synchronous I/O from the main thread.
To reproduce
Artificially interrupt disk I/O or saturate disk with other I/O operations. Generate cluster topology changes. Observe tail latencies.
Expected behavior
No additional latencies should be introduced by slow disk I/O.
Additional information
Reference to rename() call:
|
if (rename(tmpfilename, server.cluster_configfile) == -1) { |
Describe the bug
In
clusterSaveConfig(), there are synchronous I/O operations, includingclose()andrename(). If I/O is delayed or blocked, possibly by disk contention, this may result in large latencies on the Valkey main thread.We should avoid synchronous I/O from the main thread.
To reproduce
Artificially interrupt disk I/O or saturate disk with other I/O operations. Generate cluster topology changes. Observe tail latencies.
Expected behavior
No additional latencies should be introduced by slow disk I/O.
Additional information
Reference to
rename()call:valkey/src/cluster_legacy.c
Line 887 in 81d1b99