-
Notifications
You must be signed in to change notification settings - Fork 790
SOLR-17955: OTEL metrics: SplitShardCmd.checkDiskSpace needs conversion #3859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| if (indexSize == -1.0) { | ||
| log.warn("cannot verify information for parent shard leader"); | ||
| return; | ||
| } | ||
| double indexSize = size.doubleValue(); | ||
|
|
||
| Number freeSize = | ||
| (Number) rsp.getResponse()._get(List.of("metrics", freeDiskSpaceMetricName), null); | ||
| if (freeSize == null) { | ||
| if (freeSize == -1.0) { | ||
| log.warn("missing node disk space information for parent shard leader"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking for here, this should throw instead of just return and continuing with the shard split cmd. Tests were passing because of this. Then we could at least know there was a regression. Was this just return for some specific purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least assert but I'm +1 to just throw if you wish.
|
|
||
| SolrResponse resp = req.process(cloudManager.getSolrClient()); | ||
|
|
||
| double[] sizes = new double[] {-1.0, -1.0}; // [indexSize, freeSize] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why an array?
| if (indexSize == -1.0) { | ||
| log.warn("cannot verify information for parent shard leader"); | ||
| return; | ||
| } | ||
| double indexSize = size.doubleValue(); | ||
|
|
||
| Number freeSize = | ||
| (Number) rsp.getResponse()._get(List.of("metrics", freeDiskSpaceMetricName), null); | ||
| if (freeSize == null) { | ||
| if (freeSize == -1.0) { | ||
| log.warn("missing node disk space information for parent shard leader"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least assert but I'm +1 to just throw if you wish.
| SolrRequest.METHOD.GET, "/admin/metrics", SolrRequest.SolrRequestType.ADMIN, params); | ||
| req.setResponseParser(new InputStreamResponseParser("prometheus")); | ||
|
|
||
| SolrResponse resp = req.process(cloudManager.getSolrClient()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is going to talk to some arbitrary node, not necessarily the node that has the specific core we are going to split. To do that, you can get the URL from the Replica, truncate to the node, and use Http2SolrClient.requestWithBaseUrl
https://issues.apache.org/jira/browse/SOLR-17955
Splitshard disk space check was broken when switching the /admin/metrics api to prometheus. This fixes that by reading the parsed prometheus output.