Skip to content

Commit 81ef547

Browse files
committed
mmaprototype: pass *rebalanceState as parameter to shedStore function
Change the shedStore IIFE to accept *rebalanceState as a parameter instead of capturing it from the outer scope. This prepares the function for extraction to a standalone method on *rebalanceState.
1 parent 8397059 commit 81ef547

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/kv/kvserver/allocator/mmaprototype/cluster_state_rebalance_stores.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (cs *clusterState) rebalanceStores(
176176
lastFailedChangeDelayDuration: lastFailedChangeDelayDuration,
177177
}
178178
for idx /*logging only*/, store := range sheddingStores {
179-
func() {
179+
func(rs *rebalanceState) {
180180
log.KvDistribution.Infof(ctx, "start processing shedding store s%d: cpu node load %s, store load %s, worst dim %s",
181181
store.StoreID, store.nls, store.sls, store.worstDim)
182182
ss := rs.cs.stores[store.StoreID]
@@ -602,7 +602,7 @@ func (cs *clusterState) rebalanceStores(
602602
rs.shouldContinue = true
603603
return
604604
}
605-
}()
605+
}(rs)
606606
if rs.shouldReturnEarly {
607607
return rs.changes
608608
}

0 commit comments

Comments
 (0)