You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/10/28 03:08:01 UTC

[GitHub] [solr] patsonluk opened a new pull request, #1143: SOLR-16506 : Throws exception on core startup for node name mismatch

patsonluk opened a new pull request, #1143:
URL: https://github.com/apache/solr/pull/1143

   https://issues.apache.org/jira/browse/SOLR-16506
   
   <!--
   _(If you are a project committer then you may remove some/all of the following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system for Solr:
   
   * https://issues.apache.org/jira/projects/SOLR
   
   For something minor (i.e. that wouldn't be worth putting in release notes), you can skip JIRA. 
   To create a Jira issue, you will need to create an account there first.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * SOLR-####: <short description of problem or changes>
   
   SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
   
   
   # Description
   
   Please provide a short description of the changes you're making with this pull request.
   
   # Solution
   
   Please provide a short description of the approach taken to implement your solution.
   
   # Tests
   
   Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [ ] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [ ] I have created a Jira issue and added the issue ID to my pull request title.
   - [ ] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [ ] I have developed this patch against the `main` branch.
   - [ ] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   - [ ] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] noblepaul commented on a diff in pull request #1143: SOLR-16506 : Throws exception on core startup for node name mismatch

Posted by GitBox <gi...@apache.org>.
noblepaul commented on code in PR #1143:
URL: https://github.com/apache/solr/pull/1143#discussion_r1007585071


##########
solr/core/src/java/org/apache/solr/cloud/ZkController.java:
##########
@@ -2899,6 +2920,23 @@ public NotInClusterStateException(ErrorCode code, String msg) {
     }
   }
 
+  /**
+   * Thrown during pre-register process if the replica is found in clusterstate but is inconsistent
+   * with current node name
+   */
+  public static class InconsistentClusterStateException extends SolrException {

Review Comment:
   Why a new Exception? The `replica` field is not used anywhere



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] noblepaul commented on a diff in pull request #1143: SOLR-16506: Throws exception on core startup for node name mismatch

Posted by GitBox <gi...@apache.org>.
noblepaul commented on code in PR #1143:
URL: https://github.com/apache/solr/pull/1143#discussion_r1008984713


##########
solr/core/src/java/org/apache/solr/cloud/ZkController.java:
##########
@@ -2899,6 +2920,23 @@ public NotInClusterStateException(ErrorCode code, String msg) {
     }
   }
 
+  /**
+   * Thrown during pre-register process if the replica is found in clusterstate but is inconsistent
+   * with current node name
+   */
+  public static class InconsistentClusterStateException extends SolrException {

Review Comment:
   My concern is that this Exception is not caught anywhere or we do not do an `instanceof` check



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] patsonluk commented on a diff in pull request #1143: SOLR-16506: Throws exception on core startup for node name mismatch

Posted by GitBox <gi...@apache.org>.
patsonluk commented on code in PR #1143:
URL: https://github.com/apache/solr/pull/1143#discussion_r1009628884


##########
solr/core/src/java/org/apache/solr/cloud/ZkController.java:
##########
@@ -2899,6 +2920,23 @@ public NotInClusterStateException(ErrorCode code, String msg) {
     }
   }
 
+  /**
+   * Thrown during pre-register process if the replica is found in clusterstate but is inconsistent
+   * with current node name
+   */
+  public static class InconsistentClusterStateException extends SolrException {

Review Comment:
   Since this is a non runtime exception, the caller should be forced to handle such exception specifically or this should fall to any handling of unexpected exceptions of existing logic? :)
   
   In this case, the caller `preRegister` does already have handling for general unexpected exception, so this is supposed to work as is - be wrapped at `SolrException`, re-thrown and caught in `createFromDescriptor`, but unlike `NotInClusterStateException`, which unload(delete) the physical directory, it will just interrupt the core loading, wrapped and thrown again, and finally be logged in `CoreContainer#load` without affecting other cores.
   
   Such described flow is already the handling of any unexpected exception which I find quite fitting for our scenario. And there's an added test case to ensure a single `InconsistentClusterStateException ` should not affect loading of other "healthy" cores. 
   
   Lemme know if you have any thoughts on different handling! 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] patsonluk commented on pull request #1143: SOLR-16506: Throws exception on core startup for node name mismatch

Posted by "patsonluk (via GitHub)" <gi...@apache.org>.
patsonluk commented on PR #1143:
URL: https://github.com/apache/solr/pull/1143#issuecomment-1714784748

   Mismatching node name could happen when `-Dhost` is used, under such circumstances, it is desirable to publish a down state with the updated node name (this probably explains the [check](https://github.com/apache/solr/blob/11253f05cfb31f9fb945c831d8889b3db1e607f1/solr/core/src/java/org/apache/solr/cloud/ZkController.java#L2035) here).
   
   Closing this proposal as this change could prevent the correct handling.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] patsonluk commented on pull request #1143: SOLR-16506: Throws exception on core startup for node name mismatch

Posted by "patsonluk (via GitHub)" <gi...@apache.org>.
patsonluk commented on PR #1143:
URL: https://github.com/apache/solr/pull/1143#issuecomment-1481678376

   > How does this interact with the `genericCoreNodeNames` option in [the solr.xml](https://solr.apache.org/guide/solr/latest/configuration-guide/configuring-solr-xml.html#the-solrcloud-element)? It seems like that is made so that cores can be moved between nodes...
   
   Thank you for the raising the concern @HoustonPutman , I was not aware of such option! From my brief search the reference on `ZkController#genericCoreNodeNames`/`cloudConfig.getGenericCoreNodeNames()`, it only appears to affect the result of `getCoreNodeName`. So I assume the `Replica#getNodeName` (read from the state.json, which `genericCoreNodeNames` should not matter?) would still be a mismatch to the `ZkController#getNodeName`.
   
   However, ur concern does lead me to think deeper on several scenarios, which I think would be great if you can provide some insights:
   1. From `genericCoreNodeNames`, it mentions the case of `When a different machine takes over serving that core things will be much easier to understand.`. I assume all replica modes should be done via admin APIs (ie MOVESHARD/REPLACENODE) etc, which should update the state.json accordingly. Do we support some other forms of moves? like physically moving the folders around and expect Solr to detect the change and "self correct" the state.json? My approach assumes that if state.json is incorrect, we should not attempt to self-correct it, but I could have misunderstood some of the designs 😓 
   2. What about node name changes on a host? For example if we used to pass IP as `-Dhost` but now with the hostname, should we assume that Solr would start up fine and state.json will be "self-corrected"?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] patsonluk closed pull request #1143: SOLR-16506: Throws exception on core startup for node name mismatch

Posted by "patsonluk (via GitHub)" <gi...@apache.org>.
patsonluk closed pull request #1143: SOLR-16506: Throws exception on core startup for node name mismatch
URL: https://github.com/apache/solr/pull/1143


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] patsonluk commented on a diff in pull request #1143: SOLR-16506 : Throws exception on core startup for node name mismatch

Posted by GitBox <gi...@apache.org>.
patsonluk commented on code in PR #1143:
URL: https://github.com/apache/solr/pull/1143#discussion_r1007601857


##########
solr/core/src/java/org/apache/solr/cloud/ZkController.java:
##########
@@ -2899,6 +2920,23 @@ public NotInClusterStateException(ErrorCode code, String msg) {
     }
   }
 
+  /**
+   * Thrown during pre-register process if the replica is found in clusterstate but is inconsistent
+   * with current node name
+   */
+  public static class InconsistentClusterStateException extends SolrException {

Review Comment:
   The new exception better identifies a new type of exception. This cannot be `NotInClusterStateException`, otherwise the `CoreContainer` will attempt to unload (ie delete)  the core at https://github.com/fullstorydev/lucene-solr/blob/release/8.8/solr/core/src/java/org/apache/solr/core/CoreContainer.java#L1525.
   
   The extra field is just to store the info which could be useful for any future handling/logging



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] HoustonPutman commented on pull request #1143: SOLR-16506: Throws exception on core startup for node name mismatch

Posted by "HoustonPutman (via GitHub)" <gi...@apache.org>.
HoustonPutman commented on PR #1143:
URL: https://github.com/apache/solr/pull/1143#issuecomment-1481529037

   How does this interact with the `genericCoreNodeNames` option in [the solr.xml](https://solr.apache.org/guide/solr/latest/configuration-guide/configuring-solr-xml.html#the-solrcloud-element)? It seems like that is made so that cores can be moved between nodes...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org