-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Treat Setting value with empty array string as empty array #10625
Treat Setting value with empty array string as empty array #10625
Conversation
Compatibility status:Checks if related components are compatible with change 6f21088 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/performance-analyzer.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/sql.git] |
Gradle Check (Jenkins) Run Completed with:
|
I'm concerned about the potential blast-radius of this change. Can we apply this logic only when reading settings from environment variables instead? |
The change is in class Also, as far as I understand, the code that reads in the environment variable is located in |
server/src/main/java/org/opensearch/common/settings/Setting.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
178bf08
to
fe32d29
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Jeongmin Yu <machenity@gmail.com>
…], ["a", "b", "c"], ...) Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
fe32d29
to
8144ee7
Compare
Gradle Check (Jenkins) Run Completed with:
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #10625 +/- ##
============================================
+ Coverage 71.15% 71.17% +0.01%
- Complexity 58783 58797 +14
============================================
Files 4885 4885
Lines 277199 277216 +17
Branches 40285 40290 +5
============================================
+ Hits 197247 197308 +61
- Misses 63448 63474 +26
+ Partials 16504 16434 -70 ☔ View full report in Codecov by Sentry. |
@msfroh friendly ping please |
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
❌ Gradle check result for 6f21088: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 6f21088: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
…h-project#10625) * Treat Setting value with empty array string as empty array Signed-off-by: Jeongmin Yu <machenity@gmail.com> * Allow to pass the list settings through environment variables (like [], ["a", "b", "c"], ...) Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Jeongmin Yu <machenity@gmail.com> Signed-off-by: Andriy Redko <andriy.redko@aiven.io> Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
…h-project#10625) * Treat Setting value with empty array string as empty array Signed-off-by: Jeongmin Yu <machenity@gmail.com> * Allow to pass the list settings through environment variables (like [], ["a", "b", "c"], ...) Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Jeongmin Yu <machenity@gmail.com> Signed-off-by: Andriy Redko <andriy.redko@aiven.io> Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
…h-project#10625) * Treat Setting value with empty array string as empty array Signed-off-by: Jeongmin Yu <machenity@gmail.com> * Allow to pass the list settings through environment variables (like [], ["a", "b", "c"], ...) Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Jeongmin Yu <machenity@gmail.com> Signed-off-by: Andriy Redko <andriy.redko@aiven.io> Co-authored-by: Andriy Redko <andriy.redko@aiven.io> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
According to the documentation, to create a dedicated coordinating node , empty array (
[]
) should be set asnode.roles
setting in the opensearch.yml document. The problem is that when I pass the setting value"[]"
(env variables are always strings) via an environment variable, OpenSearch's environment variable parser does not determine it as an empty array and uses it as a string of"[]"
. As a result, it was not possible to create a dedicated coordinating node using an environment variable.This PR fixes this so that if a listSetting value that is
"[]" + any whitespaces
, it is treated as an empty array.Related Issues
Resolves #3412
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.