Skip to content

Commit b4bd06c

Browse files
committed
mmaprototype: move doneShedding declaration into replica rebalancing block
Move the doneShedding variable declaration from the beginning of rebalanceStore into the code block that contains the replica rebalancing logic. This narrows the variable's scope to where it's actually used and prepares for extracting this code into a separate method.
1 parent ac2e740 commit b4bd06c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ func (rs *rebalanceState) rebalanceStore(
197197
store.StoreID, store.nls, store.sls, store.worstDim)
198198
ss := rs.cs.stores[store.StoreID]
199199

200-
doneShedding := false
201200
if true {
202201
// Debug logging.
203202
topKRanges := ss.adjusted.topKRanges[localStoreID]
@@ -238,6 +237,7 @@ func (rs *rebalanceState) rebalanceStore(
238237

239238
log.KvDistribution.VInfof(ctx, 2, "attempting to shed replicas next")
240239
{
240+
doneShedding := false
241241
if store.StoreID != localStoreID && store.dimSummary[CPURate] >= overloadSlow &&
242242
now.Sub(ss.overloadStartTime) < remoteStoreLeaseSheddingGraceDuration {
243243
log.KvDistribution.VInfof(ctx, 2, "skipping remote store s%d: in lease shedding grace period", store.StoreID)

0 commit comments

Comments
 (0)