Implementation of allow actions in red cluster feature - #1691
Conversation
PR Reviewer Guide 🔍(Review updated until commit 656bb29)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 656bb29 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 5cf9135
Suggestions up to commit d179596
Suggestions up to commit 25efabd
Suggestions up to commit c7308c2
Suggestions up to commit f71095e
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1691 +/- ##
==========================================
+ Coverage 76.85% 76.96% +0.10%
==========================================
Files 388 388
Lines 18655 18684 +29
Branches 2619 2622 +3
==========================================
+ Hits 14338 14380 +42
+ Misses 3024 3011 -13
Partials 1293 1293 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @bowenlan-amzn, Please provide feedback :) |
|
Hi @vikasvb90 , @bowenlan-amzn , @Tarun-kishore Any feedback on the PR is welcomed :) |
| // ALLOW_RUNNING_ON_RED_CLUSTER is enabled. These either create new indices, require | ||
| // shard allocation, or add significant I/O load, all of which can further degrade an | ||
| // already red cluster instead of helping it recover. | ||
| val RED_CLUSTER_RESTRICTED_ACTIONS: Set<String> = |
There was a problem hiding this comment.
I would rather have a list of allowed action and block all rest. Otherwise, any new action that is added would be allowed to run on red cluster by default.
e78c0ad to
f71095e
Compare
|
Persistent review updated to latest commit f71095e |
| DeleteAction.name, | ||
| CloseAction.name, | ||
| ReadOnlyAction.name, | ||
| ReadWriteAction.name, |
There was a problem hiding this comment.
moving index to read_write state can potentially degrade the cluster stability, as indexing load will be increased on an existing red cluster. Should we consider skipping it?
There was a problem hiding this comment.
Yes, it makes sense to remove read_write from the allow-list. Although the action itself is lightweight, it re-enables indexing, which can increase disk, CPU, memory, and recovery pressure on an already red cluster. Since it is not recovery-oriented, skipping it is the safer behavior.
There was a problem hiding this comment.
@Tarun-kishore , have pushed a new commit with the changes. Please share your comments.
|
Persistent review updated to latest commit c7308c2 |
|
New changes lgtm. |
|
@skumarp7 Can you fix the CI failures. |
|
Persistent review updated to latest commit 25efabd |
25efabd to
d179596
Compare
|
Persistent review updated to latest commit d179596 |
The CI seems to be failing due to a Kotlin compilation error in TransformRestTestCase.kt. The issue is with the deprecated RestClient class from the Java/OpenSearch client library. Should i supress the deprecation warnings ? |
|
I checked the failure as well, those are because of RestClient deprecation warning. Since those are unrelated to this change, created a separate PR for that: #1702. |
|
@skumarp7 Can you add ITs for these changes. |
|
Persistent review updated to latest commit 5cf9135 |
Signed-off-by: skumarp <sanjay.kumar_p@nokia.com>
Signed-off-by: skumarp <sanjay.kumar_p@nokia.com>
Signed-off-by: skumarp <sanjay.kumar_p@nokia.com>
Verify delete opt-in behavior and ensure read-write waits for cluster recovery. Signed-off-by: skumarp <sanjay.kumar_p@nokia.com>
5cf9135 to
656bb29
Compare
|
Persistent review updated to latest commit 656bb29 |
Have added some ITs, let me know if they are okay? |
Add opt-in setting to run ISM jobs on a red cluster
Problem
ISM does not execute managed-index jobs while the cluster health is red. When a
cluster turns red (for example due to disk pressure), delete policies that would
free up space never run, so the cluster cannot recover on its own without manual
intervention (issue #1127).
Approach
Introduce an opt-in, dynamic cluster setting that lets operators allow ISM to keep
running while the cluster is red, while still protecting the cluster from actions
that would make a red cluster worse.
New dynamic setting plugins.index_state_management.allow_running_on_red_cluster
(NodeScope, Dynamic, default false) so existing behavior is unchanged and it can
be toggled at runtime. It is registered in IndexManagementPlugin and tracked live
in ManagedIndexRunner via addSettingsUpdateConsumer.
Gate the existing red-cluster short-circuit in ManagedIndexRunner so jobs are
skipped on a red cluster only when the setting is false (today's behavior). When
the setting is true, execution proceeds.
Safety guard: even when the override is enabled, a curated set of actions that
create indices, require shard allocation, or add heavy I/O (force_merge,
replica_count, shrink, snapshot, rollover, open, allocation,
convert_index_to_remote, transform, rollup) are still skipped on a red cluster,
because running them could further degrade an already red cluster. Recovery
oriented actions such as delete continue to run so policies can help the cluster
recover. This is expressed via RED_CLUSTER_RESTRICTED_ACTIONS and
isActionAllowedOnRedCluster() in ManagedIndexSettings.
Tests
allowed vs. restricted action classification (delete allowed, resource-intensive
actions restricted).
Relates to #1127