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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org