[bugfix](fe) should use equals not == to get failed to select replica message (#45602)
### What problem does this PR solve? The original code use == to filter tag, it is wrong.
This commit is contained in:
@ -178,7 +178,8 @@ public class SimpleScheduler {
|
||||
}
|
||||
|
||||
blacklistBackends.put(backendID, Pair.of(Config.blacklist_duration_second + 1, reason));
|
||||
LOG.warn("add backend {} to black list. reason: {}", backendID, reason);
|
||||
// Should print the exception stack, so that we will know when it is added to blacklist.
|
||||
LOG.warn("add backend {} to black list. reason: {}", backendID, reason, new Exception());
|
||||
}
|
||||
|
||||
public static boolean isAvailable(Backend backend) {
|
||||
|
||||
@ -237,7 +237,8 @@ public class BeSelectionPolicy {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("computeNode=%s | query=%s | load=%s | schedule=%s | tags=%s(%s) | medium=%s",
|
||||
return String.format("computeNode=%s | query=%s | load=%s | schedule=%s | tags=%s |"
|
||||
+ "resource_downgrade=%s | medium=%s",
|
||||
preferComputeNode, needQueryAvailable, needLoadAvailable, needScheduleAvailable,
|
||||
resourceTags.stream().map(tag -> tag.toString()).collect(Collectors.joining(",")),
|
||||
this.allowResourceTagDowngrade, storageMedium);
|
||||
|
||||
@ -563,7 +563,7 @@ public class SystemInfoService {
|
||||
StringBuilder sb = new StringBuilder(" Backends details: ");
|
||||
for (Tag tag : replicaAlloc.getAllocMap().keySet()) {
|
||||
sb.append("backends with tag ").append(tag).append(" is ");
|
||||
sb.append(idToBackendRef.values().stream().filter(be -> be.getLocationTag() == tag)
|
||||
sb.append(idToBackendRef.values().stream().filter(be -> be.getLocationTag().equals(tag))
|
||||
.map(Backend::getDetailsForCreateReplica)
|
||||
.collect(Collectors.toList()));
|
||||
sb.append(", ");
|
||||
|
||||
Reference in New Issue
Block a user