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 2023/01/02 22:10:16 UTC

[GitHub] [solr] vatsalpatel3689 opened a new pull request, #1264: Branch 9 1 neo

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

   https://issues.apache.org/jira/browse/SOLR-XXXXX
   
   <!--
   _(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] sonatype-lift[bot] commented on a diff in pull request #1264: Branch 9 1 neo

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on code in PR #1264:
URL: https://github.com/apache/solr/pull/1264#discussion_r1060204105


##########
cluster/scripts/deleteAndReAddNodes.sh:
##########
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+
+endpoint=$1
+collection=$2
+shard=$3
+replicaType=$4
+nodesFileName=$5
+batchSize=$6
+sleepBetweenDeleteAndReAdd=$7
+sleepBetweenBatches=$8
+
+IFS=$'\n' read -d '' -r -a nodeIPs < ${nodesFileName}
+
+date
+startTimestamp=$(date +%s)
+
+len=${#nodeIPs[@]}
+
+if (( $batchSize > $len )); then
+    batchSize=${len}
+fi
+
+batchNumber=1
+count=0

Review Comment:
   <picture><img alt="30% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/30/display.svg"></picture>
   
   *[SC2034](https://github.com/koalaman/shellcheck/wiki/SC2034):*  count appears unused. Verify use (or export if used externally).
   
   ---
   
   <details><summary><b>ℹī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=365223287&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=365223287&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365223287&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365223287&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=365223287&lift_comment_rating=5) ]



##########
cluster/scripts/deleteReplica.sh:
##########
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+endpoint=$1
+collection=$2
+shard=$3
+replica=$4
+
+date
+startTimestamp=$(date +%s)
+
+echo "collection: $collection, shard: $shard, replica: $replica"
+curl "http://$endpoint:8983/solr/admin/collections?action=DELETEREPLICA&collection=$collection&shard=$shard&replica=$replica"
+echo "$replica deleted"
+
+currentTimestamp=$(date +%s)
+echo "timeElapsed $(($currentTimestamp-$startTimestamp))"

Review Comment:
   đŸ’Ŧ 18 similar findings have been found in this PR
   
   ---
   
   *[SC2004](https://github.com/koalaman/shellcheck/wiki/SC2004):*  $/${} is unnecessary on arithmetic variables.
   
   ---
   
   <details><summary><b>🔎 Expand here to view all instances of this finding</b></summary><br/>
     
     
   <div align=\"center\">
   
   
   | **File Path** | **Line Number** |
   | ------------- | ------------- |
   | cluster/scripts/deleteReplica.sh | [16](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteReplica.sh#L16) |
   | cluster/scripts/deleteNodes.sh | [18](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteNodes.sh#L18) |
   | cluster/scripts/deleteNodes.sh | [20](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteNodes.sh#L20) |
   | cluster/scripts/deleteNodes.sh | [20](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteNodes.sh#L20) |
   | cluster/scripts/deleteAndReAddNodes.sh | [19](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteAndReAddNodes.sh#L19) |
   | cluster/scripts/deleteAndReAddNodes.sh | [19](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteAndReAddNodes.sh#L19) |
   | cluster/scripts/deleteAndReAddNodes.sh | [30](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteAndReAddNodes.sh#L30) |
   | cluster/scripts/deleteAndReAddNodes.sh | [30](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteAndReAddNodes.sh#L30) |
   | cluster/scripts/deleteAndReAddNodes.sh | [31](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteAndReAddNodes.sh#L31) |
   | cluster/scripts/deleteAndReAddNodes.sh | [31](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteAndReAddNodes.sh#L31) |
   <p> Showing <b>10</b> of <b> 18 </b> findings. <a href="https://lift.sonatype.com/results/github.com/apache/solr/01GNT8PWYPVC8Y33DCS827YVZ0?t=Shellcheck|SC2004" target="_blank">Visit the Lift Web Console</a> to see all.</p></div></details>
   
   
   
   ---
   
   <details><summary><b>ℹī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=365223278&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=365223278&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365223278&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365223278&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=365223278&lift_comment_rating=5) ]



##########
cluster/scripts/deleteNodes.sh:
##########
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+endpoint=$1
+nodesFileName=$2
+
+IFS=$'\n' read -d '' -r -a nodeIPs < ${nodesFileName}

Review Comment:
   <picture><img alt="36% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/36/display.svg"></picture>
   
   đŸ’Ŧ 3 similar findings have been found in this PR
   
   ---
   
   *[SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086):*  Double quote to prevent globbing and word splitting.
   
   ---
   
   <details><summary><b>🔎 Expand here to view all instances of this finding</b></summary><br/>
     
     
   <div align=\"center\">
   
   
   | **File Path** | **Line Number** |
   | ------------- | ------------- |
   | cluster/scripts/deleteAndReAddNodes.sh | [12](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteAndReAddNodes.sh#L12) |
   | cluster/scripts/deleteAndReAddNodes.sh | [43](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteAndReAddNodes.sh#L43) |
   | cluster/scripts/deleteAndReAddNodes.sh | [60](https://github.com/apache/solr/blob/b3a99f336a983fec079e0675ca67ffc1ff1389f4/cluster/scripts/deleteAndReAddNodes.sh#L60) |
   <p><a href="https://lift.sonatype.com/results/github.com/apache/solr/01GNT8PWYPVC8Y33DCS827YVZ0?t=Shellcheck|SC2086" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
   
   
   
   ---
   
   <details><summary><b>ℹī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=365223280&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=365223280&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365223280&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365223280&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=365223280&lift_comment_rating=5) ]



-- 
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] vatsalpatel3689 closed pull request #1264: Branch 9 1 neo

Posted by GitBox <gi...@apache.org>.
vatsalpatel3689 closed pull request #1264: Branch 9 1 neo
URL: https://github.com/apache/solr/pull/1264


-- 
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] sonatype-lift[bot] commented on a diff in pull request #1264: Branch 9 1 neo

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on code in PR #1264:
URL: https://github.com/apache/solr/pull/1264#discussion_r1060207647


##########
solr/core/build.gradle:
##########
@@ -15,21 +15,34 @@
  * limitations under the License.
  */
 
-
 apply plugin: 'java-library'
 
 description = 'Apache Solr Core'
 
-configurations.all {
-  exclude group: 'log4j', module: 'log4j'
-  exclude group: 'commons-logging', module: 'commons-logging'
-  exclude group: 'org.slf4j', module: 'slf4j-log4j12'
-  exclude group: 'org.apache.yetus', module: 'audience-annotations'
-  exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
-  // be conservative on what's added here.  Affects *all* configs, including internal ones.
+configurations {
+  // jettyClientImplementation should be used for all jetty client libraries used by the Solr Server.
+  // These libraries must be available in the WEB-INF/lib, as well as server/lib.
+  // Jetty does not allow for these specific libraries to be accessed from the webapp, if they only live in server/lib.
+  // Note: because of SolrEmbedded, this is not all jetty libraries.
+  // (Solr Core requires the jetty server libraries because of embedded Solr, however the webapp does not use these)
+  jettyClientImplementation
+  implementation {
+    extendsFrom jettyClientImplementation
+  }
 }
 
 dependencies {
+  // Spotbugs Annotations are only needed for old findbugs
+  // annotation usage like in Zookeeper during compilation time.
+  // It is not included in the release so exclude from checks.

Review Comment:
   <picture><img alt="52% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/52/display.svg"></picture>
   
   *High Vulnerability:*
   ### maven : com.fasterxml.jackson/jackson-bom : 2.13.4.20221013
   0 Critical, 1 High, 0 Medium, 0 Low vulnerabilities have been found across 1 dependencies.
   [View the Lift console](https://lift.sonatype.com/results/github.com/apache/solr/01GNT8J2TTRR28BFJBCQHAWT5S?tab=dependencies&component=pkg%3Amaven%2Fcom.fasterxml.jackson%2Fjackson-bom%402.13.4.20221013) for details about these vulnerabilities.
   
   ---
   
   <details><summary><b>ℹī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=365232422&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=365232422&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365232422&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365232422&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=365232422&lift_comment_rating=5) ]



##########
solr/core/src/java/org/apache/solr/search/facet/FacetModule.java:
##########
@@ -380,26 +400,24 @@ public Object getMergedResult() {
       return getDouble();
     }
 
-
     @Override
     public int compareTo(FacetSortableMerger other, FacetRequest.SortDirection direction) {
       return compare(getDouble(), ((FacetDoubleMerger) other).getDouble(), direction);
     }
 
-
     public static int compare(double a, double b, FacetRequest.SortDirection direction) {
       if (a < b) return -1;
       if (a > b) return 1;
 
-      if (a != a) {  // a==NaN
+      if (a != a) { // a==NaN

Review Comment:
   <picture><img alt="39% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/39/display.svg"></picture>
   
   đŸ’Ŧ 2 similar findings have been found in this PR
   
   ---
   
   *opt.semgrep.java.lang.correctness.eqeq.eqeq:*  `a == a` or `a != a` is always true. (Unless the value compared is a float or double).
   To test if `a` is not-a-number, use `Double.isNaN(a)`.
   
   
   ---
   
   <details><summary><b>🔎 Expand here to view all instances of this finding</b></summary><br/>
     
     
   <div align=\"center\">
   
   
   | **File Path** | **Line Number** |
   | ------------- | ------------- |
   | solr/core/src/java/org/apache/solr/search/facet/FacetModule.java | [413](https://github.com/apache/solr/blob/93d6905e1854c7122c78991310044ccfc6f05ebc/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java#L413) |
   | solr/core/src/java/org/apache/solr/search/facet/FacetModule.java | [419](https://github.com/apache/solr/blob/93d6905e1854c7122c78991310044ccfc6f05ebc/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java#L419) |
   <p><a href="https://lift.sonatype.com/results/github.com/apache/solr/01GNT8J2TTRR28BFJBCQHAWT5S?t=Semgrep|opt.semgrep.java.lang.correctness.eqeq.eqeq" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
   
   
   
   ---
   
   <details><summary><b>ℹī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=365232823&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=365232823&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365232823&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365232823&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=365232823&lift_comment_rating=5) ]



-- 
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