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

Cleanup BWC versions #5311

Merged
merged 1 commit into from
Nov 21, 2022
Merged

Cleanup BWC versions #5311

merged 1 commit into from
Nov 21, 2022

Conversation

adnapibar
Copy link
Contributor

Description

Remove all checks put in place supporting legacy ES versions. Cleanup old versions no longer bwc supported.

Issues Resolved

N/A

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Rabi Panda adnapibar@gmail.com

Remove all checks put in place supporting legacy ES versions. Cleanup old versions no longer bwc supported

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.index.ShardIndexingPressureConcurrentExecutionTests.testCoordinatingPrimaryThreadedUpdateToShardLimitsAndRejections

@codecov-commenter
Copy link

Codecov Report

Merging #5311 (a2ac320) into main (7dc137f) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #5311      +/-   ##
============================================
- Coverage     71.03%   71.03%   -0.01%     
- Complexity    58129    58136       +7     
============================================
  Files          4704     4704              
  Lines        277266   277244      -22     
  Branches      40147    40136      -11     
============================================
- Hits         196957   196940      -17     
- Misses        64129    64214      +85     
+ Partials      16180    16090      -90     
Impacted Files Coverage Δ
...c/main/java/org/opensearch/gradle/BwcVersions.java 91.48% <100.00%> (+3.14%) ⬆️
.../org/opensearch/index/MockEngineFactoryPlugin.java 0.00% <0.00%> (-100.00%) ⬇️
...org/opensearch/test/engine/MockInternalEngine.java 0.00% <0.00%> (-78.27%) ⬇️
.../org/opensearch/test/engine/MockEngineSupport.java 0.00% <0.00%> (-63.56%) ⬇️
.../org/opensearch/client/indices/AnalyzeRequest.java 31.00% <0.00%> (-47.00%) ⬇️
...opensearch/persistent/PersistentTasksExecutor.java 22.22% <0.00%> (-44.45%) ⬇️
.../admin/cluster/reroute/ClusterRerouteResponse.java 60.00% <0.00%> (-40.00%) ⬇️
...h/action/ingest/SimulateDocumentVerboseResult.java 60.71% <0.00%> (-39.29%) ⬇️
...luster/routing/allocation/RoutingExplanations.java 62.06% <0.00%> (-37.94%) ⬇️
...ensearch/client/indices/DetailAnalyzeResponse.java 20.54% <0.00%> (-34.25%) ⬇️
... and 455 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -342,7 +325,7 @@ private Map<Integer, List<Version>> getReleasedMajorGroupedByMinor() {

public void compareToAuthoritative(List<Version> authoritativeReleasedVersions) {
Set<Version> notReallyReleased = new HashSet<>(getReleased());
notReallyReleased.removeAll(authoritativeReleasedVersions);
authoritativeReleasedVersions.forEach(notReallyReleased::remove);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, why removeAll didn't cut?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The performance of set.removeAll depends upon the size of the set vs the passed collection and the performance of the contains method of the passed collection. Here is the Java Doc. In this case, the method is called by passing the list of released versions from maven which is going to be bigger than the list of released versions in Versions.java

Copy link
Collaborator

Choose a reason for hiding this comment

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

That is correct, and the removeAll is smart enough to make the decision (according to same Javadoc), if we really care about performance here (which is always good but may be sometimes not strictly necessary), we probably should represent the List<Version> authoritativeReleasedVersions as a Set<Version> (why do we need duplicates here?) in the first place, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we could change the type to set but it would require some further changes. Do you have any particular concern with this refactoring?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not, not necessarily the concern but curiosity

@adnapibar adnapibar merged commit 94b8dfd into opensearch-project:main Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants