-
Notifications
You must be signed in to change notification settings - Fork 73
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
Rename settings from OpenDistro and OpenSearch, with backwards compatibility, using fallback #20
Conversation
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
f9d83fd
to
4f43b10
Compare
Signed-off-by: dblock <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dblock for the changes, Overall LGTM
- Would it make sense to add ITs to this and see how would settings update via API behave with fallback.
- While this is good was wondering if we simply had a way to say
key.replaceFirst("^opendisto", "opensearch")
src/test/java/com/amazon/opendistroforelasticsearch/jobscheduler/JobSchedulerSettingsTests.java
Outdated
Show resolved
Hide resolved
src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/sweeper/JobSweeper.java
Outdated
Show resolved
Hide resolved
.put("opendistro.jobscheduler.request_timeout", "1s") | ||
.put("opendistro.jobscheduler.sweeper.backoff_millis", "2ms") | ||
.put("opendistro.jobscheduler.retry_count", 3) | ||
.put("opendistro.jobscheduler.sweeper.period", "4s") | ||
.put("opendistro.jobscheduler.sweeper.page_size", 5) | ||
.put("opendistro.jobscheduler.jitter_limit", 6) | ||
.build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use LegacyOpenDistroJobSchedulerSettings constants here maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually would rather not. If I were to make a mistake or a typo in the actual rename in the setting, or someone accidentally bulk replaces opendistro by openseaerch, the test will point to a behavior change or start failing. Which is what we really want. WDYT?
Probably. I'll take a look at what's possible.
The settings infrastructure supports upgrades, fallbacks, archiving settings, and a lot more. So some kind of |
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the changes look good the me!
Thanks for the change!
path: OpenSearch | ||
- name: Build OpenSearch | ||
working-directory: ./OpenSearch | ||
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=beta1 -Dbuild.snapshot=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the changes, I see we are leveraging fallbackSetting
to take care of legacy settings.
Ref: https://github.com/opensearch-project/OpenSearch/blob/0ba0e7cc26060f964fcbf6ee45bae53b3a9941d0/server/src/main/java/org/opensearch/common/settings/Setting.java#L1703:38
Moving to 1.x might not be needed.
But eventually we will have to build out of 1.x.
Let me know your thoughts on this, I propose:
- cut a branch for
1.0.0.0-beta1
for all the plugins. 1.0.0.0-beta1
will still build out of OpenSearch1.0.0-beta1
, this helps having stable builds.main
will build out of the latest feature branch on OpenSearch, in this case1.x
, this helps absorbing changes from dependencies sooner rather than later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm confused what's what :)
Right now OpenSearch#main is 2.0 and OpenSearch#1.x is 1.0, right? Beta1 is old news.
This change depends on opensearch-project/OpenSearch#665, ie. opensearch-project/OpenSearch@b1b563d. Right now that's in main
and 1.x
.
So what should be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that makes sense. I didn't realize you've added changes to support fallback settings :).
Makes sense. Ignore my comments above.
@Bukhtawar I tried to write an integration test across multiple versions of ODFE/ES/OpenSearch, but that looks complicated. I opened opensearch-project/OpenSearch#670, if you know how to best do that pls add comments. |
…ibility, using fallback (opensearch-project#20)
UPDATE 5/19/21: the names for settings in this PR are
opensearch.
(e.g.opensearch.jobscheduler.retry_count
), but have decided to make those namesplugins.jobscheduler.retry_count
, since. Please see https://github.com/opensearch-project/opensearch-plugins/blob/main/CONVENTIONS.md#settings for the latest.Signed-off-by: dblock [email protected]
Description
An alternative to #19, depends on opensearch-project/OpenSearch#665.
opensearch.yml Settings
Manually testing upgrade path from
config/opensearch.yml
settings:Set
opendistro.jobscheduler.retry_count: 6
inconfig./opensearch.yml
.Run
./bin/opensearch
, it will show the value for this setting at 7.Node Settings (and upgrade from OpenDistro)
Install OpenDistro
Set
opendistro.jobscheduler.retry_count: 6
.Stop OpenDistro, install OpenSearch on top (or copy data). I built just the minimal engine + job-scheduler from source with these changes.
At start the default values are used before settings are read.
I thought this was a bug, but both old and new are just defaulted before they are read from the node configuration when it joins the cluster (with some debugging code).
As the node joins the cluster, it updates the value from the node configuration.
Check List
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.