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

Update setting API honors cluster's replica setting as default #14810 #14948

Merged
merged 3 commits into from
Oct 11, 2024

Conversation

chishui
Copy link
Contributor

@chishui chishui commented Jul 24, 2024

Description

This is a fix to #14810.
When user calls

PUT index/_settings
{
  "index": {
    "number_of_replicas": null
  }
}

Previous logic is always set index.number_of_replicas to 1. This PR changes the default value to the one configured by cluster setting cluster.default_number_of_replicas and if it's not configured, a same default 1 will be used. It's consistent to the default replica value when creating an index.

Related Issues

#14810

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

Copy link
Contributor

❕ Gradle check result for f9e019f: UNSTABLE

  • TEST FAILURES:
      2 org.opensearch.common.util.concurrent.QueueResizableOpenSearchThreadPoolExecutorTests.classMethod
      1 org.opensearch.common.util.concurrent.QueueResizableOpenSearchThreadPoolExecutorTests.testResizeQueueDown

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Contributor

❕ Gradle check result for a7d986e: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.98%. Comparing base (691f725) to head (85662ae).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...luster/metadata/MetadataUpdateSettingsService.java 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14948      +/-   ##
============================================
- Coverage     72.06%   71.98%   -0.08%     
+ Complexity    64822    64786      -36     
============================================
  Files          5308     5308              
  Lines        302574   302556      -18     
  Branches      43710    43709       -1     
============================================
- Hits         218048   217807     -241     
- Misses        66648    66900     +252     
+ Partials      17878    17849      -29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

❌ Gradle check result for b690c89:

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?

Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for e16d52f: 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?

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>
Copy link
Contributor

❕ Gradle check result for 9286a1b: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.snapshots.DedicatedClusterSnapshotRestoreIT.testSnapshotWithStuckNode

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@chishui
Copy link
Contributor Author

chishui commented Sep 24, 2024

This change looks good to me, please resolve the conflicts and make sure all gradle checks pass, thanks!

@gaobinlong I resolved conflict and all gradle checks passed

@gaobinlong gaobinlong added the backport 2.x Backport to 2.x branch label Sep 24, 2024
@gaobinlong
Copy link
Collaborator

@chishui could you open a documentation PR about this behavior in this repo? Maybe add it here: dynamic-index-level-index-settings, and we even don't have some documentation about the cluster level setting cluster.default_number_of_replicas, could you also help to add it here: cluster-settings.

@gaobinlong
Copy link
Collaborator

@reta @andrross @dblock mind taking a second look at this PR?

@gaobinlong
Copy link
Collaborator

@chishui could you resolve the conflicts again so that we can get this PR merged? Thanks!

Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis
Copy link
Member

@gaobinlong as maintainers we can also commit to PRs and the conflict was just the changelog so I resolved it in the GitHub UI. Should be mergeable once CI finishes.

Copy link
Contributor

✅ Gradle check result for 85662ae: SUCCESS

@reta
Copy link
Collaborator

reta commented Oct 11, 2024

@reta @andrross @dblock mind taking a second look at this PR?

Sincere apologies, I have missed that, looking

@reta
Copy link
Collaborator

reta commented Oct 11, 2024

Thank you @chishui !

@reta reta merged commit b3459fd into opensearch-project:main Oct 11, 2024
38 of 39 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 11, 2024
…#14948)

* Update setting API honors cluster's replica setting as default #14810

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>

* Update changelog & add one more test case

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>

---------

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Co-authored-by: Daniel Widdis <widdis@gmail.com>
(cherry picked from commit b3459fd)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request Oct 11, 2024
…#14948) (#16287)

* Update setting API honors cluster's replica setting as default #14810



* Update changelog & add one more test case



---------




(cherry picked from commit b3459fd)

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Daniel Widdis <widdis@gmail.com>
@chishui
Copy link
Contributor Author

chishui commented Oct 12, 2024

Thank you @gaobinlong @dbwiddis @reta, I'll create a PR for doc updating later.

@chishui chishui deleted the 14810 branch October 12, 2024 02:19
@dbwiddis
Copy link
Member

Thank you @gaobinlong @dbwiddis @reta, I'll create a PR for doc updating later.

You can create an issue now, so the doc team is aware and can plan PR review workload. :)

dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 16, 2024
…arch-project#14810 (opensearch-project#14948)

* Update setting API honors cluster's replica setting as default opensearch-project#14810

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>

* Update changelog & add one more test case

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>

---------

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Co-authored-by: Daniel Widdis <widdis@gmail.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 17, 2024
…arch-project#14810 (opensearch-project#14948)

* Update setting API honors cluster's replica setting as default opensearch-project#14810

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>

* Update changelog & add one more test case

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>

---------

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Co-authored-by: Daniel Widdis <widdis@gmail.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 21, 2024
…arch-project#14810 (opensearch-project#14948)

* Update setting API honors cluster's replica setting as default opensearch-project#14810

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>

* Update changelog & add one more test case

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>

---------

Signed-off-by: Liyun Xiu <xiliyun@amazon.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Co-authored-by: Daniel Widdis <widdis@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants