Skip to content

Conversation

@mlbiscoc
Copy link
Contributor

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.

Comment on lines +901 to 909
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;
}
Copy link
Contributor Author

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?

Copy link
Contributor

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]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why an array?

Comment on lines +901 to 909
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;
}
Copy link
Contributor

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());
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants