Skip to content

Commit

Permalink
Improve auto-recovery noise log when some bookie down. (#4118)
Browse files Browse the repository at this point in the history
* Improve auto-recovery noise log when some bookie down.

* Address comment.
  • Loading branch information
horizonzy authored Jan 10, 2024
1 parent bdbb5ec commit 54168b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,26 @@ public PlacementResult<BookieId> replaceBookie(int ensembleSize, int writeQuorum
try {
excludeBookies = addDefaultRackBookiesIfMinNumRacksIsEnforced(excludeBookies);
excludeBookies.addAll(currentEnsemble);

Set<Node> ensembleNodes = new HashSet<>();
Set<Node> excludeNodes = new HashSet<>();
BookieNode bn = knownBookies.get(bookieToReplace);
if (null == bn) {
bn = createBookieNode(bookieToReplace);
}

Set<Node> ensembleNodes = convertBookiesToNodes(currentEnsemble);
Set<Node> excludeNodes = convertBookiesToNodes(excludeBookies);
for (BookieId bookieId : currentEnsemble) {
if (bookieId.equals(bookieToReplace)) {
continue;
}
ensembleNodes.add(convertBookieToNode(bookieId));
}
for (BookieId bookieId : excludeBookies) {
if (bookieId.equals(bookieToReplace)) {
excludeNodes.add(bn);
continue;
}
excludeNodes.add(convertBookieToNode(bookieId));
}

excludeNodes.addAll(ensembleNodes);
excludeNodes.add(bn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,8 @@ protected String resolveNetworkLocation(BookieId addr) {
if (null != historyBookie) {
return historyBookie.getNetworkLocation();
}

LOG.error("Cannot resolve bookieId {} to a network address, resolving as {}", addr,
NetworkTopology.DEFAULT_REGION_AND_RACK, err);
LOG.error("Cannot resolve bookieId {} to a network address, resolving as {}. {}", addr,
NetworkTopology.DEFAULT_REGION_AND_RACK, err.getMessage());
return NetworkTopology.DEFAULT_REGION_AND_RACK;
}
}
Expand Down

0 comments on commit 54168b5

Please sign in to comment.