You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2019/10/30 10:49:12 UTC

[GitHub] [lucene-solr] CaoManhDat commented on a change in pull request #951: SOLR-13844: Remove replica recovery terms with the replica term

CaoManhDat commented on a change in pull request #951: SOLR-13844: Remove replica recovery terms with the replica term
URL: https://github.com/apache/lucene-solr/pull/951#discussion_r340544645
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/cloud/ZkShardTerms.java
 ##########
 @@ -524,15 +529,23 @@ Terms ensureHighestTermsAreNotZero() {
     }
 
     /**
-     * Return a new {@link Terms} in which term of {@code coreNodeName} is removed
+     * Return a new {@link Terms} in which terms for the {@code coreNodeName} are removed
      * @param coreNodeName of the replica
      * @return null if term of {@code coreNodeName} is already not exist
      */
     Terms removeTerm(String coreNodeName) {
-      if (!values.containsKey(coreNodeName)) return null;
+      if (!values.containsKey(recoveringTerm(coreNodeName)) && !values.containsKey(coreNodeName)) {
+        return null;
+      }
 
       HashMap<String, Long> newValues = new HashMap<>(values);
-      newValues.remove(coreNodeName);
+      if (values.containsKey(coreNodeName)) {
 
 Review comment:
   doesn't require a check here. Just blindly remove will be enough

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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