@@ -1348,17 +1348,36 @@ func (a *allocatorState) IsInConflictWithMMA(
1348
1348
if advisor .disabled {
1349
1349
return false
1350
1350
}
1351
+ // Lazily compute and cache the load summary for the existing store.
1351
1352
if advisor .existingStoreSLS == nil {
1352
- summary := a .cs .computeLoadSummary (ctx , advisor .existingStoreID ,
1353
- & advisor .means .storeLoad , & advisor .means .nodeLoad )
1353
+ summary := a .cs .computeLoadSummary (ctx , advisor .existingStoreID , & advisor .means .storeLoad , & advisor .means .nodeLoad )
1354
1354
advisor .existingStoreSLS = & summary
1355
1355
}
1356
1356
existingSLS := advisor .existingStoreSLS
1357
+ // Always compute the candidate's load summary.
1357
1358
candSLS := a .cs .computeLoadSummary (ctx , cand , & advisor .means .storeLoad , & advisor .means .nodeLoad )
1359
+
1360
+ var conflict bool
1358
1361
if cpuOnly {
1359
- return candSLS .dimSummary [CPURate ] > existingSLS .dimSummary [CPURate ]
1362
+ conflict = candSLS .dimSummary [CPURate ] > existingSLS .dimSummary [CPURate ]
1363
+ if conflict {
1364
+ log .KvDistribution .VEventf (
1365
+ ctx , 2 ,
1366
+ "mma rejected candidate s%d (cpu-only) as a replacement for s%d: candidate=%v > existing=%v" ,
1367
+ cand , advisor .existingStoreID , candSLS .dimSummary [CPURate ], existingSLS .dimSummary [CPURate ],
1368
+ )
1369
+ }
1370
+ } else {
1371
+ conflict = candSLS .sls > existingSLS .sls
1372
+ if conflict {
1373
+ log .KvDistribution .VEventf (
1374
+ ctx , 2 ,
1375
+ "mma rejected candidate s%d as a replacement for s%d: candidate=%v > existing=%v" ,
1376
+ cand , advisor .existingStoreID , candSLS .sls , existingSLS .sls ,
1377
+ )
1378
+ }
1360
1379
}
1361
- return candSLS . sls > existingSLS . sls
1380
+ return conflict
1362
1381
}
1363
1382
1364
1383
// Consider the core logic for a change, rebalancing or recovery.
0 commit comments