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

Add cluster setting cluster.restrict.index.replication_type t… #10866

Merged
merged 3 commits into from
Oct 23, 2023

Conversation

Poojita-Raj
Copy link
Contributor

@Poojita-Raj Poojita-Raj commented Oct 23, 2023

…o restrict setting of index setting replication type

Description

Introduces a cluster level setting CLUSTER_RESTRICT_INDEX_REPLICATION_TYPE_SETTING = cluster.restrict.index.replication_type that can restrict setting of index.replication.type setting in a cluster.
Default value = false.
Throws an exception when we try to set the index replication type when the cluster restrict setting is enabled.

Related Issues

Resolves #10868

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

…o restrict setting of index setting replication type

Signed-off-by: Poojita Raj <[email protected]>
@Poojita-Raj Poojita-Raj changed the title Add cluster setting CLUSTER_RESTRICT_INDEX_REPLICATION_TYPE_SETTING t… Add cluster setting cluster.restrict.index.replication_type t… Oct 23, 2023
Signed-off-by: Poojita Raj <[email protected]>
@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request Indexing:Replication Issues and PRs related to core replication framework eg segrep labels Oct 23, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

Compatibility status:

Checks if related components are compatible with change ae5a785

Incompatible components

Incompatible components: [https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/performance-analyzer.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git]

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT.test {yaml=pit/10_basic/Delete all}

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #10866 (ae5a785) into main (8f13dee) will increase coverage by 0.00%.
Report is 3 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##               main   #10866   +/-   ##
=========================================
  Coverage     71.25%   71.25%           
+ Complexity    58684    58672   -12     
=========================================
  Files          4869     4869           
  Lines        276512   276496   -16     
  Branches      40204    40203    -1     
=========================================
- Hits         197030   197026    -4     
- Misses        63020    63031   +11     
+ Partials      16462    16439   -23     
Files Coverage Δ
...h/cluster/metadata/MetadataCreateIndexService.java 79.96% <100.00%> (+0.20%) ⬆️
...rg/opensearch/common/settings/ClusterSettings.java 92.85% <ø> (ø)
...earch/index/store/RemoteSegmentStoreDirectory.java 88.84% <ø> (-0.04%) ⬇️
...rc/main/java/org/opensearch/index/store/Store.java 81.39% <100.00%> (+0.81%) ⬆️
...in/java/org/opensearch/indices/IndicesService.java 68.43% <100.00%> (-1.97%) ⬇️

... and 452 files with indirect coverage changes

Signed-off-by: Poojita Raj <[email protected]>
@Poojita-Raj
Copy link
Contributor Author

Thanks for the review @mch2! Addressed all the changes, please take another look

Copy link
Member

@mch2 mch2 left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      2 org.opensearch.index.shard.RemoteIndexShardTests.classMethod
      1 org.opensearch.index.shard.RemoteIndexShardTests.testSegRepSucceedsOnPreviousCopiedFiles

@Rishikesh1159 Rishikesh1159 merged commit 8b21739 into opensearch-project:main Oct 23, 2023
16 checks passed
@Poojita-Raj Poojita-Raj added the backport 2.x Backport to 2.x branch label Oct 23, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-10866-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8b2173910f754a48773b3283e1a511cbc1a9db78
# Push it to GitHub
git push --set-upstream origin backport/backport-10866-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-10866-to-2.x.

Poojita-Raj added a commit to Poojita-Raj/OpenSearch that referenced this pull request Oct 23, 2023
…earch-project#10866)

* Add cluster setting CLUSTER_RESTRICT_INDEX_REPLICATION_TYPE_SETTING to restrict setting of index setting replication type

Signed-off-by: Poojita Raj <[email protected]>

* Add Changelog entry

Signed-off-by: Poojita Raj <[email protected]>

* refactoring

Signed-off-by: Poojita Raj <[email protected]>

---------

Signed-off-by: Poojita Raj <[email protected]>
mch2 pushed a commit that referenced this pull request Oct 24, 2023
… (#10876)

* Add cluster setting CLUSTER_RESTRICT_INDEX_REPLICATION_TYPE_SETTING to restrict setting of index setting replication type



* Add Changelog entry



* refactoring



---------

Signed-off-by: Poojita Raj <[email protected]>
Poojita-Raj added a commit to Poojita-Raj/OpenSearch that referenced this pull request Nov 2, 2023
Poojita-Raj added a commit to Poojita-Raj/OpenSearch that referenced this pull request Nov 2, 2023
Poojita-Raj added a commit to Poojita-Raj/OpenSearch that referenced this pull request Nov 2, 2023
Poojita-Raj added a commit to Poojita-Raj/OpenSearch that referenced this pull request Nov 2, 2023
peternied pushed a commit that referenced this pull request Nov 2, 2023
dreamer-89 pushed a commit that referenced this pull request Nov 7, 2023
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…earch-project#10866)

* Add cluster setting CLUSTER_RESTRICT_INDEX_REPLICATION_TYPE_SETTING to restrict setting of index setting replication type

Signed-off-by: Poojita Raj <[email protected]>

* Add Changelog entry

Signed-off-by: Poojita Raj <[email protected]>

* refactoring

Signed-off-by: Poojita Raj <[email protected]>

---------

Signed-off-by: Poojita Raj <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
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-failed enhancement Enhancement or improvement to existing feature or request Indexing:Replication Issues and PRs related to core replication framework eg segrep
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce a cluster setting that would help restrict replication type in a cluster
3 participants