You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by sh...@apache.org on 2024/08/20 22:57:20 UTC
(bookkeeper) branch master updated: when failed to choose a bookie, print out the list of ensemble. (#4482)
This is an automated email from the ASF dual-hosted git repository.
shoothzj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 7c41204506 when failed to choose a bookie, print out the list of ensemble. (#4482)
7c41204506 is described below
commit 7c41204506122ed6904289f4814d4130274874aa
Author: Dezhiliu <33...@users.noreply.github.com>
AuthorDate: Wed Aug 21 06:57:15 2024 +0800
when failed to choose a bookie, print out the list of ensemble. (#4482)
### Motivation
In file RackawareEnsemblePlacementPolicyImpl.java
In the log.warn below, we should print out the list of ensemble, instead of the object. The “ensemble” in line-619 should be changed into “ensemble.toList()”.
https://github.com/apache/bookkeeper/blob/999cd0f2ab14404be4d6c24e388456dbe56bb1a8/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java#L600C3-L619C47
### Changes
The “ensemble” in line-619 changed into “ensemble.toList()”.
---
.../bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
index 6258ede3c3..da7fe22adb 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
@@ -590,7 +590,7 @@ public class RackawareEnsemblePlacementPolicyImpl extends TopologyAwareEnsembleP
LOG.warn("Failed to choose a bookie from network location {}, "
+ "the bookies in the network location are {}, excluded bookies {}, "
+ "current ensemble {}, fallback to choose bookie randomly from the cluster.",
- networkLoc, topology.getLeaves(networkLoc), excludeBookies, ensemble);
+ networkLoc, topology.getLeaves(networkLoc), excludeBookies, ensemble.toList());
// randomly choose one from whole cluster, ignore the provided predicate.
return selectRandom(1, excludeBookies, predicate, ensemble).get(0);
}
@@ -616,7 +616,7 @@ public class RackawareEnsemblePlacementPolicyImpl extends TopologyAwareEnsembleP
LOG.warn("Failed to choose a bookie node from network location {}, "
+ "the bookies in the network location are {}, excluded bookies {}, "
+ "current ensemble {}, fallback to choose bookie randomly from the cluster.",
- networkLoc, topology.getLeaves(networkLoc), excludeBookies, ensemble);
+ networkLoc, topology.getLeaves(networkLoc), excludeBookies, ensemble.toList());
return selectFromNetworkLocation(excludeRacks, excludeBookies, predicate, ensemble, fallbackToRandom);
}
}