mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Shard state action request logging
This commit modifies the string representation of a shard state action request. The issue being addressed is that the previous logging would log "failure: [Unknown]" for shard started actions but this just leads to confusion that there is a failure but its cause is unknown. Closes #16396
This commit is contained in:
parent
20b584c7e1
commit
0b474c6cfc
@ -435,13 +435,14 @@ public class ShardStateAction extends AbstractComponent {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(
|
||||
Locale.ROOT,
|
||||
"failed shard [%s], source shard [%s], message [%s], failure [%s]",
|
||||
shardRouting,
|
||||
sourceShardRouting,
|
||||
message,
|
||||
ExceptionsHelper.detailedMessage(failure));
|
||||
List<String> components = new ArrayList<>(4);
|
||||
components.add("failed shard [" + shardRouting + "]");
|
||||
components.add("source shard [" + sourceShardRouting + "]");
|
||||
components.add("message [" + message + "]");
|
||||
if (failure != null) {
|
||||
components.add("failure [" + ExceptionsHelper.detailedMessage(failure) + "]");
|
||||
}
|
||||
return String.join(", ", components);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user