Skip to content

Commit

Permalink
Added timer for the whole publish down ops, including persist ops
Browse files Browse the repository at this point in the history
  • Loading branch information
patsonluk committed Oct 11, 2024
1 parent 6a79752 commit 941d95d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions solr/core/src/java/org/apache/solr/cloud/ZkController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2902,13 +2902,14 @@ public boolean checkIfCoreNodeNameAlreadyExists(CoreDescriptor dcore) {
* @return the names of the collections that have replicas on the given node
*/
public Collection<String> publishNodeAsDown(String nodeName) {
final RTimer publishDownTimer = new RTimer();
log.info("Publish node={} as DOWN", nodeName);

ClusterState clusterState = getClusterState();
final RTimer startZkFetchTimer = new RTimer();
final RTimer zkFetchTimer = new RTimer();
Map<String, List<Replica>> replicasPerCollectionOnNode =
clusterState.getReplicaNamesPerCollectionOnNode(nodeName);
long zkFetchDuration = (long)startZkFetchTimer.getTime();
long zkFetchDuration = (long)zkFetchTimer.getTime();
log.info("Spent {} ms on ClusterState#getReplicaNamesPerCollectionOnNode", zkFetchDuration);
if (distributedClusterStateUpdater.isDistributedStateUpdate()) {
// Note that with the current implementation, when distributed cluster state updates are
Expand Down Expand Up @@ -2962,6 +2963,9 @@ public Collection<String> publishNodeAsDown(String nodeName) {
log.warn("Could not publish node as down: ", e);
}
}
long publishDownDuration = (long)publishDownTimer.getTime();
log.info("Spent {} ms on ZKController#publishNodeAsDown", publishDownDuration);

return replicasPerCollectionOnNode.keySet();
}

Expand Down

0 comments on commit 941d95d

Please sign in to comment.