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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.95%. Comparing base (036f6bc) to head (9286a1b).
Report is 3 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     71.92%   71.95%   +0.03%     
- Complexity    64400    64413      +13     
============================================
  Files          5281     5281              
  Lines        300995   300996       +1     
  Branches      43479    43479              
============================================
+ Hits         216491   216590      +99     
+ Misses        66793    66598     -195     
- Partials      17711    17808      +97     

☔ 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?

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Collaborator

@gaobinlong gaobinlong left a comment

Choose a reason for hiding this comment

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

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

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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

@chishui
Copy link
Contributor Author

chishui commented Sep 23, 2024

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

#16015

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?

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.

2 participants