From 8e5fd299713c303b668b40543dbc2bbd6843a6fb Mon Sep 17 00:00:00 2001 From: Henry Guo Date: Tue, 19 May 2026 05:13:30 +0000 Subject: [PATCH] fix feedback --- crates/ecstore/src/rpc/remote_disk.rs | 3 ++- rustfs/src/storage/rpc/disk.rs | 16 +++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/crates/ecstore/src/rpc/remote_disk.rs b/crates/ecstore/src/rpc/remote_disk.rs index 3a4b71a56..de5c18f0f 100644 --- a/crates/ecstore/src/rpc/remote_disk.rs +++ b/crates/ecstore/src/rpc/remote_disk.rs @@ -1601,12 +1601,13 @@ impl DiskAPI for RemoteDisk { } }; + global_internode_metrics().record_sent_bytes_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL, data_len); + if !response.success { global_internode_metrics().record_error_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL); return Err(response.error.unwrap_or_default().into()); } - global_internode_metrics().record_sent_bytes_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL, data_len); Ok(()) }, get_max_timeout_duration(), diff --git a/rustfs/src/storage/rpc/disk.rs b/rustfs/src/storage/rpc/disk.rs index 9debb3e01..ec6cf4ef4 100644 --- a/rustfs/src/storage/rpc/disk.rs +++ b/rustfs/src/storage/rpc/disk.rs @@ -933,16 +933,14 @@ impl NodeService { pub(super) async fn handle_write_all(&self, request: Request) -> Result, Status> { let request = request.into_inner(); let data_len = request.data.len(); + global_internode_metrics().record_incoming_request_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL); + global_internode_metrics().record_recv_bytes_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL, data_len); if let Some(disk) = self.find_disk(&request.disk).await { match disk.write_all(&request.volume, &request.path, request.data).await { - Ok(_) => { - global_internode_metrics().record_incoming_request_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL); - global_internode_metrics().record_recv_bytes_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL, data_len); - Ok(Response::new(WriteAllResponse { - success: true, - error: None, - })) - } + Ok(_) => Ok(Response::new(WriteAllResponse { + success: true, + error: None, + })), Err(err) => { global_internode_metrics().record_error_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL); Ok(Response::new(WriteAllResponse { @@ -964,10 +962,10 @@ impl NodeService { debug!("read all"); let request = request.into_inner(); + global_internode_metrics().record_incoming_request_for_operation(INTERNODE_OPERATION_GRPC_READ_ALL); if let Some(disk) = self.find_disk(&request.disk).await { match disk.read_all(&request.volume, &request.path).await { Ok(data) => { - global_internode_metrics().record_incoming_request_for_operation(INTERNODE_OPERATION_GRPC_READ_ALL); global_internode_metrics().record_sent_bytes_for_operation(INTERNODE_OPERATION_GRPC_READ_ALL, data.len()); Ok(Response::new(ReadAllResponse { success: true,