diff --git a/app/vminsert/netstorage/netstorage.go b/app/vminsert/netstorage/netstorage.go index a7d952868..c0a5209c4 100644 --- a/app/vminsert/netstorage/netstorage.go +++ b/app/vminsert/netstorage/netstorage.go @@ -585,7 +585,9 @@ func getHealthyStorageNodesBlocking(stopCh <-chan struct{}) []*storageNode { func spreadReroutedBufToStorageNodesBlocking(stopCh <-chan struct{}, br *bufRows) { var mr storage.MetricRow rowsProcessed := 0 - defer reroutedRowsProcessed.Add(rowsProcessed) + defer func() { + reroutedRowsProcessed.Add(rowsProcessed) + }() sns := getHealthyStorageNodesBlocking(stopCh) if len(sns) == 0 {