[CELEBORN-446][FOLLOWUP] Check rack should use nextMasterIndex.(#1496)

This commit is contained in:
Angerszhuuuu 2023-05-18 16:25:14 +08:00 committed by GitHub
parent 42219aeb2a
commit aa817bdbeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,7 +224,7 @@ public class SlotsAllocator {
int nextSlaveInd = (nextMasterInd + 1) % workers.size();
if (restrictions != null) {
while (!haveUsableSlots(restrictions, workers, nextSlaveInd)
|| !satisfyRackAware(shouldRackAware, workers, masterIndex, nextSlaveInd)) {
|| !satisfyRackAware(shouldRackAware, workers, nextMasterInd, nextSlaveInd)) {
nextSlaveInd = (nextSlaveInd + 1) % workers.size();
if (nextSlaveInd == nextMasterInd) {
break outer;
@ -233,7 +233,7 @@ public class SlotsAllocator {
storageInfo =
getStorageInfo(workers, nextSlaveInd, restrictions, workerDiskIndexForSlave);
} else if (shouldRackAware) {
while (!satisfyRackAware(true, workers, masterIndex, nextSlaveInd)) {
while (!satisfyRackAware(true, workers, nextMasterInd, nextSlaveInd)) {
nextSlaveInd = (nextSlaveInd + 1) % workers.size();
if (nextSlaveInd == nextMasterInd) {
break outer;