Skip to content

Commit

Permalink
[SOLR-17337] Show proper distributed stage id
Browse files Browse the repository at this point in the history
- Shows a proper distributed stage id instead of
  an empty string
  • Loading branch information
tboeghk committed Jun 20, 2024
1 parent 554c0de commit 1df51e7
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,27 @@ public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest
}
}

private String getDistributedStageName(int stage) {
String stageName = stages.get(stage);

if (stageName == null) {
stageName = "STAGE_" + Integer.toString(stage);
}

return stageName;
}

@Override
public void handleResponses(ResponseBuilder rb, ShardRequest sreq) {
if (rb.isDebugTrack() && rb.isDistrib && !rb.finished.isEmpty()) {
@SuppressWarnings("unchecked")
NamedList<Object> stageList =
(NamedList<Object>)
((NamedList<Object>) rb.getDebugInfo().get("track")).get(stages.get(rb.stage));
((NamedList<Object>) rb.getDebugInfo().get("track"))
.get(getDistributedStageName(rb.stage));
if (stageList == null) {
stageList = new SimpleOrderedMap<>();
rb.addDebug(stageList, "track", stages.get(rb.stage));
rb.addDebug(stageList, "track", getDistributedStageName(rb.stage));
}
for (ShardResponse response : sreq.responses) {
stageList.add(response.getShard(), getTrackResponse(response));
Expand Down

0 comments on commit 1df51e7

Please sign in to comment.