mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-20 03:22:18 +00:00
feat(ecstore): expose rename sync tail metrics (#6257)
Add default-off PUT stage helpers for fdatasync batch shape and rename quorum fanout shape so #925 follow-up probes can distinguish shard sync batching opportunities from fanout convergence. Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -1098,6 +1098,10 @@ pub(crate) async fn sync_dir_files_with_limiter(dir: impl AsRef<Path>, disk_perm
|
||||
let files = run_file_sync_blocking(disk_permits.clone(), move || {
|
||||
let files = regular_files(&scan_dir)?;
|
||||
if files.len() < PARALLEL_FILE_SYNC_THRESHOLD {
|
||||
rustfs_io_metrics::record_put_rename_fdatasync_batch(
|
||||
rustfs_io_metrics::PUT_RENAME_FDATASYNC_BATCH_MODE_SERIAL,
|
||||
files.len(),
|
||||
);
|
||||
sync_files(&files)?;
|
||||
let fsync_started = rustfs_io_metrics::put_stage_timer();
|
||||
let result = fsync_dir_std(scan_dir);
|
||||
@@ -1115,6 +1119,10 @@ pub(crate) async fn sync_dir_files_with_limiter(dir: impl AsRef<Path>, disk_perm
|
||||
let Some(files) = files else {
|
||||
return Ok(());
|
||||
};
|
||||
rustfs_io_metrics::record_put_rename_fdatasync_batch(
|
||||
rustfs_io_metrics::PUT_RENAME_FDATASYNC_BATCH_MODE_PARALLEL,
|
||||
files.len(),
|
||||
);
|
||||
futures::stream::iter(files.into_iter().map(Ok::<_, io::Error>))
|
||||
.try_for_each_concurrent(MAX_PARALLEL_FILE_SYNCS, |path| {
|
||||
let disk_permits = disk_permits.clone();
|
||||
|
||||
@@ -3417,6 +3417,25 @@ impl SetDisks {
|
||||
quorum_wait_started,
|
||||
);
|
||||
let (results, mut file_infos) = fanout_result.map_err(|_| DiskError::Unexpected)?;
|
||||
if rustfs_io_metrics::put_stage_metrics_enabled() {
|
||||
let mut fanout_success = 0;
|
||||
let mut fanout_error = 0;
|
||||
let mut fanout_panic = 0;
|
||||
for result in &results {
|
||||
match result {
|
||||
Ok(Ok(_)) => fanout_success += 1,
|
||||
Ok(Err(_)) => fanout_error += 1,
|
||||
Err(_) => fanout_panic += 1,
|
||||
}
|
||||
}
|
||||
rustfs_io_metrics::record_put_rename_quorum_wait_fanout(
|
||||
results.len(),
|
||||
write_quorum,
|
||||
fanout_success,
|
||||
fanout_error,
|
||||
fanout_panic,
|
||||
);
|
||||
}
|
||||
|
||||
for (idx, result) in results.iter().enumerate() {
|
||||
match result {
|
||||
|
||||
Reference in New Issue
Block a user