-
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
Add support for index create block #4607
Conversation
Gradle Check (Jenkins) Run Completed with:
|
07407c7
to
ae3cdf4
Compare
Gradle Check (Jenkins) Run Completed with:
|
ae3cdf4
to
4bd7473
Compare
Gradle Check (Jenkins) Run Completed with:
|
4bd7473
to
6dee99c
Compare
Gradle Check (Jenkins) Run Completed with:
|
6dee99c
to
ac2fa38
Compare
Gradle Check (Jenkins) Run Completed with:
|
ac2fa38
to
a9dfed9
Compare
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ 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
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
server/src/internalClusterTest/java/org/opensearch/blocks/CreateIndexBlockIT.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java
Outdated
Show resolved
Hide resolved
a9dfed9
to
9b5b322
Compare
Gradle Check (Jenkins) Run Completed with:
|
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) { |
There was a problem hiding this comment.
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))
@@ -43,7 +43,8 @@ public enum ClusterBlockLevel { | |||
READ, | |||
WRITE, | |||
METADATA_READ, | |||
METADATA_WRITE; | |||
METADATA_WRITE, | |||
CREATE_NEW_INDEX; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
server/src/main/java/org/opensearch/action/admin/indices/create/TransportCreateIndexAction.java
Show resolved
Hide resolved
Write PR title using imperative mood. |
Gradle Check (Jenkins) Run Completed with:
|
org.opensearch.cluster.block.IndexCreateBlockException.class, | ||
org.opensearch.cluster.block.IndexCreateBlockException::new, | ||
165, | ||
UNKNOWN_VERSION_ADDED |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
d304a45
to
9f99dca
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Rishav Sagar <[email protected]>
Signed-off-by: Rishav Sagar <[email protected]>
Signed-off-by: Rishav Sagar <[email protected]>
b32763d
to
54cf77a
Compare
Gradle Check (Jenkins) Run Completed with:
|
129aa76
to
1b155d7
Compare
Gradle Check (Jenkins) Run Completed with:
|
1b155d7
to
052ad75
Compare
Gradle Check (Jenkins) Run Completed with:
|
…ption Signed-off-by: Rishav Sagar <[email protected]>
052ad75
to
bd99a2e
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
The backport to
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 |
The backport to
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 |
@RS146BIJAY Are you going to backport this to 2.x? |
@andrross this will go in 2.6 release. Yes I will back port it for 2.x branch. |
The backport to
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 |
@RS146BIJAY Please ensure this PR along with #5852 get backported |
Sure will backport both these PR on 2.x branch on priority. |
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
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.