Skip to content

Commit 16e86a7

Browse files
committed
feat/bulk-wal:
Enhance error handling and metrics in `bulk_insert.rs` - Updated `Inserter` to improve error handling by capturing the result of `datanode.handle(request)` and incrementing the `DIST_INGEST_ROW_COUNT` metric with the number of affected rows.
1 parent 95accb6 commit 16e86a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/operator/src/bulk_insert.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,15 @@ impl Inserter {
103103
.with_label_values(&["datanode_handle"])
104104
.start_timer();
105105
let datanode = self.node_manager.datanode(&datanode).await;
106-
return datanode
106+
let result = datanode
107107
.handle(request)
108108
.await
109109
.context(error::RequestRegionSnafu)
110110
.map(|r| r.affected_rows);
111+
if let Ok(rows) = result {
112+
crate::metrics::DIST_INGEST_ROW_COUNT.inc_by(rows as u64);
113+
}
114+
return result;
111115
}
112116

113117
let mut mask_per_datanode = HashMap::with_capacity(region_masks.len());

0 commit comments

Comments
 (0)