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

[Remove] Remove deprecated methods from JodaCompatibleZonedDateTime which are called by scripts #3346

Merged
merged 1 commit into from
May 16, 2022

Conversation

reta
Copy link
Collaborator

@reta reta commented May 16, 2022

Signed-off-by: Andriy Redko andriy.redko@aiven.io

Description

There are number of deprecated methods in JodaCompatibleZonedDateTime which are still available in scripts. Those should be removed since in some cases they pose significant performance overhead (due to deprecation warnings).

Issues Resolved

Closes #3156 and #3345

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

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.

@reta reta requested a review from a team as a code owner May 16, 2022 20:38
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 68f49f4f93b2df18c7c805aeb8e1ce5f130c423e
Log 5378

Reports 5378

@@ -427,120 +401,7 @@ public ZonedDateTime withZoneSameInstant(ZoneId zone) {
return dt.withZoneSameInstant(zone);
}

@Deprecated
Copy link
Member

Choose a reason for hiding this comment

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

Are you also looking at backporting this to 2.0?
If not, can we start curating a breaking changes meta issue for 3.0?
This is a breaking change and there could be plugins in the wild using these methods.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, sorry, forgot to add the labels.

@saratvemulapalli
Copy link
Member

start gradle check

@saratvemulapalli
Copy link
Member

@reta precommit is failing because of a forbidden API:

Forbidden method invocation: java.time.format.DateTimeFormatter#ofPattern(java.lang.String) [Uses default locale]

  in org.opensearch.script.JodaCompatibleZonedDateTimeTests (JodaCompatibleZonedDateTimeTests.java:191)

@reta reta added backport 2.x Backport to 2.x branch backport 2.0 Backport to 2.0 branch labels May 16, 2022
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 68f49f4f93b2df18c7c805aeb8e1ce5f130c423e
Log 5379

Reports 5379

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 1562f9ff898feb42ff7cf4f294035fc81d10d1d9
Log 5380

Reports 5380

@reta reta mentioned this pull request May 16, 2022
10 tasks
@reta reta changed the title Remove deprecated methods from JodaCompatibleZonedDateTime which are called by scripts [Remove] Remove deprecated methods from JodaCompatibleZonedDateTime which are called by scripts May 16, 2022
…called by scripts

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 403b947
Log 5381

Reports 5381

@saratvemulapalli saratvemulapalli added >breaking Identifies a breaking change. v3.0.0 Issues and PRs related to version 3.0.0 v2.0.0 Version 2.0.0 labels May 16, 2022
@saratvemulapalli saratvemulapalli merged commit c470580 into opensearch-project:main May 16, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 16, 2022
…called by scripts (#3346)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit c470580)
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 16, 2022
…called by scripts (#3346)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit c470580)
saratvemulapalli pushed a commit that referenced this pull request May 17, 2022
…called by scripts (#3346) (#3347)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit c470580)

Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
saratvemulapalli pushed a commit that referenced this pull request May 17, 2022
…called by scripts (#3346) (#3348)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit c470580)

Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
@kavilla
Copy link
Member

kavilla commented May 18, 2022

I believe this might be a large breaking change to get merged into 2.0. OpenSearch Dashboards and visualizes utilizes painless scripts. I did not expect that we were removing this for 2.0 so a lot of tests are failing and I can see others who have their painless scripts defined will need to ensure update them prior to migrating to OpenSearch 2.0.

It's okay but I think this is a huge impact to the community and even I was caught by surprise even though I'm a maintainer on OpenSearch Dashboards. Maybe I missed this heads up but was this called out a head of time?

@saratvemulapalli
Copy link
Member

saratvemulapalli commented May 18, 2022

@kavilla its fair. Ideally deprecated method usage should have been migrated. But we agree it was not the right practice we removed it after launching RC1. It should have been in the RC1 but we missed the train.
We do document all the breaking changes in #2480 and via >breaking label. If you have other suggestions to notify consumers in a better way, we'd love to hear.

@reta I'll go revert this in 2.0, 2.x line and let it go out in 3.x to unblock the build for 2.0 release.
Let me know if you strongly feel otherwise.

I've removed the entry in 2.0 breaking changes(#2480) and added this into 3.0 (#3351)

peterzhuamazon pushed a commit that referenced this pull request May 18, 2022
…ich are called by scripts (#3346) (#3347)" (#3394)

This reverts commit 3537b5a.

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
peterzhuamazon pushed a commit that referenced this pull request May 19, 2022
…ich are called by scripts (#3346) (#3348)" (#3393)

This reverts commit a764fde.

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
@reta
Copy link
Collaborator Author

reta commented May 19, 2022

@saratvemulapalli sounds good, thank you, sorry for that @kavilla

@reta
Copy link
Collaborator Author

reta commented May 19, 2022

@kavilla I will create an issue on OpenSearch Dashboards, the deprecated methods introduce significant overhead because of the deprecation logger (vs actual useful work the methods do), we have to migrate the scripts to use the non-deprecated variants.

kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request May 19, 2022
Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
opensearch-project#1600

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
kavilla added a commit to opensearch-project/OpenSearch-Dashboards that referenced this pull request May 20, 2022
* [Build][Tests] handle painless scripts update

Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
#1600

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Jun 8, 2022
* [Build][Tests] handle painless scripts update

Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
opensearch-project#1600

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Jun 16, 2022
* [Build][Tests] handle painless scripts update

Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
opensearch-project#1600

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
saratvemulapalli added a commit that referenced this pull request Jun 24, 2022
* Revert "Remove deprecated methods from JodaCompatibleZonedDateTime which are called by scripts (#3346) (#3347)"

This reverts commit 3537b5a.

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Bumping 2.x to 2.2

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Updating lucene verion for 2.1

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
@saratvemulapalli saratvemulapalli mentioned this pull request Jul 18, 2022
5 tasks
pjfitzgibbons pushed a commit to pjfitzgibbons/OpenSearch-Dashboards that referenced this pull request Aug 10, 2022
* [Build][Tests] handle painless scripts update

Sample data and functional tests were utilizing deprecated
methods for painless scripts.

However these deprecated methods were removed in:
opensearch-project/OpenSearch#3346

This is to ensure sample data and ftr tests work but end users
saved objects might contain painless scripts that we might not
be able to address. So we should research if this it is
possible to help mitigate this.

Related issue:
opensearch-project#1600

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport 2.0 Backport to 2.0 branch >breaking Identifies a breaking change. v2.0.0 Version 2.0.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Calling getMillis() in Painless script is slow
4 participants