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 support for index create block #4607

Merged
merged 5 commits into from
Jan 5, 2023

Conversation

RS146BIJAY
Copy link
Contributor

@RS146BIJAY RS146BIJAY commented Sep 27, 2022

Signed-off-by: Rishav Sagar [email protected]

Description

We want a way to dynamically trigger a setting to apply index create block. This block should only prevent index creation, while write should continue to happen on the existing index.

Issues Resolved

#4603

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2022

Codecov Report

Merging #4607 (b32763d) into main (be64e82) will decrease coverage by 0.07%.
The diff coverage is 56.52%.

@@             Coverage Diff              @@
##               main    #4607      +/-   ##
============================================
- Coverage     71.07%   70.99%   -0.08%     
+ Complexity    58687    58685       -2     
============================================
  Files          4763     4764       +1     
  Lines        279874   279895      +21     
  Branches      40408    40412       +4     
============================================
- Hits         198907   198705     -202     
- Misses        64658    65033     +375     
+ Partials      16309    16157     -152     
Impacted Files Coverage Δ
...earch/cluster/block/IndexCreateBlockException.java 0.00% <0.00%> (ø)
...rg/opensearch/common/settings/ClusterSettings.java 91.89% <ø> (ø)
...action/admin/cluster/settings/SettingsUpdater.java 91.17% <20.00%> (-5.65%) ⬇️
...va/org/opensearch/cluster/block/ClusterBlocks.java 83.91% <33.33%> (-0.78%) ⬇️
.../main/java/org/opensearch/OpenSearchException.java 92.38% <100.00%> (-1.23%) ⬇️
...min/indices/create/TransportCreateIndexAction.java 96.15% <100.00%> (+0.69%) ⬆️
...rg/opensearch/cluster/block/ClusterBlockLevel.java 100.00% <100.00%> (ø)
...java/org/opensearch/cluster/metadata/Metadata.java 88.27% <100.00%> (-0.61%) ⬇️
...adonly/AddIndexBlockClusterStateUpdateRequest.java 0.00% <0.00%> (-75.00%) ⬇️
...readonly/TransportVerifyShardIndexBlockAction.java 9.75% <0.00%> (-73.18%) ⬇️
... and 518 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@RS146BIJAY RS146BIJAY marked this pull request as ready for review September 28, 2022 06:48
@RS146BIJAY RS146BIJAY requested review from a team and reta as code owners September 28, 2022 06:48
@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

Gradle Check (Jenkins) Run Completed with:

@@ -204,6 +204,13 @@ public ClusterBlockException globalBlockedException(ClusterBlockLevel level) {
return new ClusterBlockException(global(level));
}

public IndexCreateBlockException createIndexBlockedException(ClusterBlockLevel level) {
if (globalBlocked(level) == false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

just use if (!globalBlocked(level))

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -43,7 +43,8 @@ public enum ClusterBlockLevel {
READ,
WRITE,
METADATA_READ,
METADATA_WRITE;
METADATA_WRITE,
CREATE_NEW_INDEX;
Copy link
Member

Choose a reason for hiding this comment

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

nit: Why not just CREATE_INDEX?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will address this in the next revision.

@sachinpkale
Copy link
Member

Write PR title using imperative mood.

@RS146BIJAY RS146BIJAY changed the title Adding support for index create block in OpenSearch Add support for index create block Oct 20, 2022
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

org.opensearch.cluster.block.IndexCreateBlockException.class,
org.opensearch.cluster.block.IndexCreateBlockException::new,
165,
UNKNOWN_VERSION_ADDED
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why UNKNOWN_VERSION_ADDED and not 3.0.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will address this in next revision. I have not associated this exception with any ES version similar to other blocks: https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/OpenSearchException.java#L1045

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.indices.replication.SegmentReplicationIT.testCancelPrimaryAllocation

@RS146BIJAY RS146BIJAY force-pushed the disk-guardrails branch 2 times, most recently from 129aa76 to 1b155d7 Compare January 5, 2023 12:20
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.indices.replication.SegmentReplicationIT.testRestartPrimary

@Bukhtawar Bukhtawar merged commit c21c899 into opensearch-project:main Jan 5, 2023
@gbbafna gbbafna added backport 2.x Backport to 2.x branch backport 2.5 labels Jan 11, 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:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-4607-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c21c899892240db1b8a29f7237257c4c0c81fa99
# Push it to GitHub
git push --set-upstream origin backport/backport-4607-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

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

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.5 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.5 2.5
# Navigate to the new working tree
pushd ../.worktrees/backport-2.5
# Create a new branch
git switch --create backport/backport-4607-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c21c899892240db1b8a29f7237257c4c0c81fa99
# Push it to GitHub
git push --set-upstream origin backport/backport-4607-to-2.5
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.5

Then, create a pull request where the base branch is 2.5 and the compare/head branch is backport/backport-4607-to-2.5.

@andrross
Copy link
Member

@RS146BIJAY Are you going to backport this to 2.x?

@RS146BIJAY
Copy link
Contributor Author

@andrross this will go in 2.6 release. Yes I will back port it for 2.x branch.

@andrross andrross added backport 2.x Backport to 2.x branch v2.6.0 'Issues and PRs related to version v2.6.0' labels Jan 26, 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:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-4607-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c21c899892240db1b8a29f7237257c4c0c81fa99
# Push it to GitHub
git push --set-upstream origin backport/backport-4607-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

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

@andrross
Copy link
Member

@RS146BIJAY Please ensure this PR along with #5852 get backported

@RS146BIJAY
Copy link
Contributor Author

Sure will backport both these PR on 2.x branch on priority.

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 v2.6.0 'Issues and PRs related to version v2.6.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants