Skip to content
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

SOLR-16507: Change SplitShardCmd to not use NodeStateProvider #1485

Merged
merged 4 commits into from Mar 31, 2023

Conversation

vinayakphegde
Copy link
Contributor

use metric API instead of NodeStateProvider in SplitShardCmd.

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

Thanks.
The verbosity is needless and is proving Andrzej's point but once it's simplified, I think we can show it's better than NodeStateProvider.

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

Just looking to tighten this further

cloudManager.request(
new GenericSolrRequest(SolrRequest.METHOD.GET, "/admin/metrics", params));
} catch (Exception e) {
log.error("Error occurred while checking the disk space of the node");
Copy link
Contributor

Choose a reason for hiding this comment

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

always propagate the exception!

Comment on lines 903 to 906
if (rsp.getResponse() == null) {
log.warn("cannot verify 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.

I would love to get rid of this. There will be a response. If it can be shown that there isn't in weird cases, I'd rather improve such weird cases so Solr code can make such guarantees without needless/verbose null checks.
You could not declare the "rsp" even; just immediately grab the all-important NamedList.

@dsmiley dsmiley requested a review from sigram March 24, 2023 12:53
@dsmiley
Copy link
Contributor

dsmiley commented Mar 24, 2023

Looking good! I think a net improvement. After this change, NodeStateProvider and its related weird named things (Snitches) is only used in one place.

WDYT @sigram ? (BTW I tagged you for review on another unrelated PR by accident)

@noblepaul
Copy link
Contributor

LGTM , snitch must be removed anyway

@dsmiley dsmiley marked this pull request as ready for review March 29, 2023 04:07
Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

@noblepaul if you have recommendations on how to proceed with simplifying NodeStateProvider / removing Snitch, then please share in the JIRA issue as there's a conversation there already.

I tested this PR locally; looks good. Thanks Vinayak!

I'm going to merge this into main with a CHANGES.txt for the next release in the "Other" section something simple like this:

  • SOLR-16507: Change SplitShardCmd to not use NodeStateProvider (Vinayak Hegde, David Smiley)

And we can add onto that entry with another PR that does more for the same issue.

@noblepaul
Copy link
Contributor

hen please share in the JIRA issue as there's a conversation there already.

I shall submit a PR for the JIRA

@dsmiley dsmiley merged commit 9fa1eba into apache:main Mar 31, 2023
0 of 2 checks passed
@dsmiley dsmiley changed the title SOLR-16507: Remove NodeStateProvider & Snitch SOLR-16507: Change SplitShardCmd to not use NodeStateProvider Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants